The Motorola 680x0 machines include the instruction Decrement and Branch According to Condition, which has the following

Question:

The Motorola 680x0 machines include the instruction Decrement and Branch According to Condition, which has the following form:
DBcc Dn, displacement
where cc is one of the testable conditions, Dn is a general-purpose register, and displacement specifies the target address relative to the current address. The instruction can be defined as follows:
if (cc False)
then begin
Dn : = (Dn) - 1;
if Dn ≠ 1 then PC : = (PC) + displacement end
else PC : = (PC) + 2;
When the instruction is executed, the condition is first tested to determine whether the termination condition for the loop is satisfied. If so, no operation is performed and execution continues at the next instruction in sequence. If the condition is false, the specified data register is decremented and checked to see if it is less than zero. If it is less than zero, the loop is terminated and execution continues at the next instruction in sequence. Otherwise, the program branches to the specified location. Now consider the following assembly language program fragment:
AGAIN CMPM.L (A0) +,(A1)+
DBNE D1, AGAIN
NOP
Two strings addressed by A0 and A1 are compared for equality; the string pointers are incremented with each reference. D1 initially contains the number of longwords (4 bytes) to be compared.
a. The initial contents of the registers are and (the $ indicates hexadecimal notation). Memory between $4000 and $6000 is loaded with words $AAAA. If the foregoing program is run, specify the number of times the DBNE loop is executed and the contents of the three registers when the NOP instruction is reached.
b. Repeat (a), but now assume that memory between $4000 and $4FEE is loaded with $0000 and between $5000 and $6000 is loaded with $AAA.
Fantastic news! We've Found the answer you've been seeking!

Step by Step Answer:

Question Posted: