11.07.2015 Views

section 7 - Index of

section 7 - Index of

section 7 - Index of

SHOW MORE
SHOW LESS

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

REP Repeat Next Instruction REPOperation:Assembler Syntax:LC -+ TEMP; X:ea -+ LC REP X:eaRepeat next instruction until LC=1TEMP -+ LCLC -+ TEMP; X:aa -+ LC REP X:aaRepeat next instruction until LC=1TEMP -+ LCLC -+ TEMP; Y:ea -+ LC REP Y:eaRepeat next instruction until LC=1TEMP -+ LCLC -+ TEMP; Y:aa -+ LC REP Y:aaRepeat next instruction until LC=1TEMP -+ LCLC -+ TEMP; S -+ LC REP SRepeat next instruction until LC=1TEMP -+ LCLC -+ TEMP; #xxx -+ LC REP #xxxRepeat next instruction until LC=1TEMP -+ LCDescription: Repeat the single-word instruction immediately following the REPinstruction the specified number <strong>of</strong> times. The value specifying the number <strong>of</strong> times thegiven instruction is to be repeated is loaded into the 16-bit loop counter (LC) register.The single-word instruction is then executed the specified number <strong>of</strong> times, decrementingthe loop counter (LC) after each execution until LC=1. When the REP instruction is ineffect, the repeated instruction is fetched only one time, and it remains in the instructionregister for the duration <strong>of</strong> the loop count. Thus, the REP instruction is not Interrupt­Ible (sequential repeats are also not interruptible). The current loop counter (LC) value isstored in an internal temporary register. If LC is set equal to zero, the instruction isrepeated 65,536 times. The instruction's effective address specifies the address <strong>of</strong> thevalue which is to be loaded into the loop counter (LC). All address register indirectaddressing modes may be used. The absolute short and the immediate short addressingmodes may also be used. The four MS bits <strong>of</strong> the 12-bit immediate value are zeroed t<strong>of</strong>orm the 16-bit value that is to be loaded into the loop counter (LC).

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!