Top-Level System Design 301
these two instructions have executed the first time, the first memory
element of the block will have been copied.
After the copy operation, the program needs to check if it is done.
Instruction 8 compares the address in register 1 versus the end address
in register 6 to see if the copy operation has completed the last element.
If so, the program should exit because the copy operation has completed.
However, in this simple example, there is no other program to execute, so
this program branches to instruction 00 and starts the process over again.
If the copy operation is not completed, the CPU executes the instruc-
tion at 0A, which increments register 1. This instruction increments
register 1 so that it points to the next element to be copied. Instruction
0Bincrements register 2, which moves the destination address to the
next location.
Finally, instruction 0Cbranches back to instruction 06 and continues
the next copy operation. Figures 12-7 and 12-8 show the memory array
before the copy and after.
Figure 12-7
The Memory Array
Before the Copy.