The world’s Largest Sharp Brain Virtual Experts Marketplace Just a click Away
Levels Tought:
University
| Teaching Since: | Apr 2017 |
| Last Sign in: | 441 Weeks Ago, 3 Days Ago |
| Questions Answered: | 9562 |
| Tutorials Posted: | 9559 |
bachelor in business administration
Polytechnic State University Sanluis
Jan-2006 - Nov-2010
CPA
Polytechnic State University
Jan-2012 - Nov-2016
Professor
Harvard Square Academy (HS2)
Mar-2012 - Present
Â
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:

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:

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 long words (4 bytes) to be compared.
Â
a. The initial contents of the registers areÂ
Â
 (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.
Â
Â
-----------