## Invitation to Computer Science 8th Edition

Assuming that variables $a, b, c,$ and $d$ are stored in memory locations $100,$ $101,102,$ and $103,$ respectively: $\begin{array}{llll} {\text {Memory}} & {\text {} } & {\text {Address} } & {\text {} }\\ {\text {Location }} & {\text {Op Code} } & {\text {Field} } & {\text { Comment} }\\ {50} & {\text { LOAD }} & {103} & {\text { R contains the value } d} \\ {51} & {\text { STORE }} & {100} & {\text { And store it into } a} \\ {52} & {\text { COMPARE }} & {100,102} & {\text { Compare } a \text { and } c, \text { set condition codes }} \\ {53} & {\text { JUMPGT }} & {58} & {\text { Jump to address } 58 \text { if } a>c} \\ {54} & {\text { LOAD }} & {100} & {\text { R now contains the (current) value of a}}\\ {55} & {\text { ADD }} & {101} & {\text { R now contains the value } a+b} \\ {56} & {\text { STORE }} & {100} & {\text { And store that sum into } a} \\ {57} & {\text { JUMP }} & {52} & {\text { Jump back to test loop condition again}}\\ {58} & {\text { }} & { } & {\text { The next instruction begins here} }\\ \end{array}$
Assuming that variables $a, b, c,$ and $d$ are stored in memory locations $100,$ $101,102,$ and $103,$ respectively: $\begin{array}{llll} {\text {Memory}} & {\text {} } & {\text {Address} } & {\text {} }\\ {\text {Location }} & {\text {Op Code} } & {\text {Field} } & {\text { Comment} }\\ {50} & {\text { LOAD }} & {103} & {\text { R contains the value } d} \\ {51} & {\text { STORE }} & {100} & {\text { And store it into } a} \\ {52} & {\text { COMPARE }} & {100,102} & {\text { Compare } a \text { and } c, \text { set condition codes }} \\ {53} & {\text { JUMPGT }} & {58} & {\text { Jump to address } 58 \text { if } a>c} \\ {54} & {\text { LOAD }} & {100} & {\text { R now contains the (current) value of a}}\\ {55} & {\text { ADD }} & {101} & {\text { R now contains the value } a+b} \\ {56} & {\text { STORE }} & {100} & {\text { And store that sum into } a} \\ {57} & {\text { JUMP }} & {52} & {\text { Jump back to test loop condition again}}\\ {58} & {\text { }} & { } & {\text { The next instruction begins here} }\\ \end{array}$