Academic Integrity: tutoring, explanations, and feedback — we don’t complete graded work or submit on a student’s behalf.

If the M68K did not provide an ADC instruction, you could nonetheless implement

ID: 2079050 • Letter: I

Question

If the M68K did not provide an ADC instruction, you could nonetheless implement multiple-precision addition. Assume you have two 64-bit integers A and B; the most-significant longword of A starts at memory location 8000 and the least-significant longword starts at memory location 8004. Similarly, the two longwords of B start at memory locations 9000 and 9004. Write a sequence of instructions that add these 64-bit quantities and leave the sum in registers DO (the most-significant longword) and D1 (the least-significant longword).

Explanation / Answer

ORG   $1000

MOVEA.W   #8000,A0

MOVEA.W   #9000,A1

MOVE.L   (A0),D1

ADD.L   (A1),D1

MOVE.L    (A0+2),D0

ADDX.L    (A1+2),D0

RTS

Hire Me For All Your Tutoring Needs
Integrity-first tutoring: clear explanations, guidance, and feedback.
Drop an Email at
drjack9650@gmail.com
Chat Now And Get Quote