Invitation to Computer Science 8th Edition

Published by Cengage Learning
ISBN 10: 1337561916
ISBN 13: 978-1-33756-191-4

Chapter 6 - 6.3 - Assemblers and Assembly Language - Practice Problem - Page 299: 1a

Answer

$\begin{array}{lll} {\text { $\qquad $ }} & {\text {INCREMENT } }& {\text {X} } \\ {\text {}} & {\text {.} } & {\text {} } \\ {\text {}} & {\text {.} } & {\text {} } \\ {\text {}} & {\text {.} } & {\text {} } \\ {\text {X:}} & {\text {.DATA} } & {\text {0} } \\ \end{array}$ --- $\text {Another way to do the same thing is}$ $\begin{array}{lll} {\text { $\qquad $ }} & {\text {STORE $\qquad $} }& {\text {X} } \\ {\text {}} & {\text {.} } & {\text {} } \\ {\text {}} & {\text {.} } & {\text {} } \\ {\text {}} & {\text {.} } & {\text {} } \\ {\text {ONE:}} & {\text {.DATA} } & {\text {1} } \\ {\text {X:}} & {\text {.DATA} } & {\text {0} } \\ \end{array}$ $\text {However, the first way is much more efficient. It takes two fewer}$ $\text {instructions and one fewer DATA pseudo-op.}$

Work Step by Step

$\begin{array}{lll} {\text { $\qquad $ }} & {\text {INCREMENT } }& {\text {X} } \\ {\text {}} & {\text {.} } & {\text {} } \\ {\text {}} & {\text {.} } & {\text {} } \\ {\text {}} & {\text {.} } & {\text {} } \\ {\text {X:}} & {\text {.DATA} } & {\text {0} } \\ \end{array}$ --- $\text {Another way to do the same thing is}$ $\begin{array}{lll} {\text { $\qquad $ }} & {\text {STORE $\qquad $} }& {\text {X} } \\ {\text {}} & {\text {.} } & {\text {} } \\ {\text {}} & {\text {.} } & {\text {} } \\ {\text {}} & {\text {.} } & {\text {} } \\ {\text {ONE:}} & {\text {.DATA} } & {\text {1} } \\ {\text {X:}} & {\text {.DATA} } & {\text {0} } \\ \end{array}$ $\text {However, the first way is much more efficient. It takes two fewer}$ $\text {instructions and one fewer DATA pseudo-op.}$
Update this answer!

You can help us out by revising, improving and updating this answer.

Update this answer

After you claim an answer you’ll have 24 hours to send in a draft. An editor will review the submission and either publish your submission or provide feedback.