section 7 - Index of
section 7 - Index of section 7 - Index of
ENDDO End Current DO Loop ENDDOOperation:SSL(LF) ~ SR;SP - 1 ~ SPSSH ~ LA; SSL ~ LC;SP -1 ~ SPAssembler Syntax:ENDDODescription: Terminate the current hardware DO loop before the current loop counter(LC) equals one. If the value of the current DO loop counter (LC) is needed, it must beread before the execution of the ENDDO instruction. Initially, the loop flag (LF) isrestored from the system stack and the remaining portion of the status register (SR) andthe program counter (PC) are purged from the system stack. The loop address (LA) andthe loop counter (LC) registers are then restored from the system stack.Restrictions: Due to pipelining and the fact that the ENDDO instruction accesses theprogram controller registers, the ENDDO instruction must not be immediately precededby any of the following instructions:Immediately before ENDDOMOVEC to LA, LC, SR, SSH, SSL, or SPMOVEM to LA, LC, SR, SSH, SSL, or SPMOVEP to LA, LC, SR, SSH, SSL, or SPMOVEC from SSHMOVEM from SSHMOVEP from SSHORIMRANDI MRREPAlso, the ENDDO instruction cannot be the last (LA) instruction in a DO loop.Example:DOYO,NEXTMOVECLC,ACMPY1,AJNE ONWARDENDDOJMP NEXTONWARDNEXT MOVE #$123456,X1;exec. loop ending at NEXT (YO) times;get current value of loop counter (LC);compare loop counter with value in Y1;go to ONWARD if LC not equal to Y1;LC equal to Y1, restore all DO registers;go to NEXT;LC not equal to Y1, continue DO loop;(Iast instruction in DO loop);(first instruction AFTER DO loop)
ENDDO End Current DO Loop ENDDOExplanation of Example: This example illustrates the use of the ENDDO instruction toterminate the current DO loop. The value of the loop counter (LC) is compared with thevalue in the Y1 register to determine if execution of the DO loop should continue. Notethat the ENDDO instruction updates certain program controller registers but does notautomatically jump past the end of the DO loop. Thus, if this action is desired, a JMPinstruction (i.e., JMP NEXT as previously shown) must be included after the ENDDOinstruction to transfer program control to the first instruction past the end of the DO loop.Condition Codes:15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0I"F I DM I T I ** I 81 I 80 I " I 10 I 8 I l I E I U N I zOpcode:23 16 15 8 7 o10 0 0 0 0 0 0 o 10 0 0 0 0 0 0 0 11 o 0 0 1 1 0 01Instruction Fields:NoneTiming: 2 oscillator clock cyclesMemory: 1 program word
- Page 287 and 288: BCHG Bit Test and Change BCHGNotes:
- Page 289 and 290: BCLR Bit Test and Clear BCLRExplana
- Page 291 and 292: BClRBit Test and ClearBClRInstructi
- Page 293 and 294: BClRBit Test and ClearBClRInstructi
- Page 295 and 296: BClR Bit Test and Clear BClRNotes:
- Page 297 and 298: BSET Bit Test and Set BSETExplanati
- Page 299 and 300: BSETBit Test and SetBSETInstruction
- Page 301 and 302: BSETBit Test and SetBSETInstruction
- Page 303 and 304: BSET Bit Test and Set BSETNotes: If
- Page 305 and 306: BTSTBit TestBTSTCondition Codes:115
- Page 307 and 308: 8TSTBit Test8TSTInstruction Format:
- Page 309 and 310: 8TSTBit Test8TSTInstruction Format:
- Page 311 and 312: CLRClear AccumulatorCLRInstruction
- Page 313 and 314: CMP Compare CMPCondition Codes:15 1
- Page 315 and 316: CMPM Compare Magnitude CMPMConditio
- Page 317 and 318: DEBUGEnter Debug ModeDEBUGOpcode:23
- Page 319 and 320: DEBUGcc Enter Debug Mode Conditiona
- Page 321 and 322: DEC Decrement by One DECInstruction
- Page 323 and 324: DIV Divide Interation DIVThe DIV in
- Page 325 and 326: DIV Divide Interation DIVNote that
- Page 327 and 328: DIVInstruction Format:DIV S,DDivide
- Page 329 and 330: DO Start Hardware Loop DOexecuted 6
- Page 331 and 332: DOStart Hardware LoopDOAt LAOther R
- Page 333 and 334: DOStart Hardware LoopDOInstruction
- Page 335 and 336: DOStart Hardware LoopDOInstruction
- Page 337: DO Start Hardware Loop DONotes: If
- Page 341 and 342: EOR Logical Exclusive OR EORInstruc
- Page 343 and 344: ILLEGALIllegal Instruction Interrup
- Page 345 and 346: INC Increment by One INCInstruction
- Page 347 and 348: Jcc Jump Conditionally JccRestricti
- Page 349 and 350: JccJump ConditionallyJccEffectiveAd
- Page 351 and 352: JCLR Jump If Bit Clear JCLRRestrict
- Page 353 and 354: JCLRJump If Bit ClearJCLRInstructio
- Page 355 and 356: JCLR Jump If Bit Clear JCLRInstruct
- Page 357 and 358: JMPJumpJMPInstruction Fields:xxx=12
- Page 359 and 360: JSccJump to Subroutine Conditionall
- Page 361 and 362: JScc Jump to Subroutine Conditional
- Page 363 and 364: JSCLR Jump to Subroutine if Bit Cle
- Page 365 and 366: JSCLRJump to Subroutine If Bit Clea
- Page 367 and 368: JSCLRJump to Subroutine If Bit Clea
- Page 369 and 370: JSCLR Jump to Subroutine If Bit Cle
- Page 371 and 372: JSET Jump if Bit Set JSETRestrictio
- Page 373 and 374: JSETJump if Bit SetJSETInstruction
- Page 375 and 376: JSET Jump If Bit Set JSETInstructio
- Page 377 and 378: JSR Jump to Subroutine JSRInstructi
- Page 379 and 380: JSSET Jump to Subroutine if Bit Set
- Page 381 and 382: JSSETJump to Subroutine if Bit SetJ
- Page 383 and 384: JSSET Jump to Subroutine if Bit Set
- Page 385 and 386: LSL Logical Shift Left LSLCondition
- Page 387 and 388: LSR Logical Shift Right LSRConditio
ENDDO End Current DO Loop ENDDOExplanation <strong>of</strong> Example: This example illustrates the use <strong>of</strong> the ENDDO instruction toterminate the current DO loop. The value <strong>of</strong> the loop counter (LC) is compared with thevalue in the Y1 register to determine if execution <strong>of</strong> the DO loop should continue. Notethat the ENDDO instruction updates certain program controller registers but does notautomatically jump past the end <strong>of</strong> the DO loop. Thus, if this action is desired, a JMPinstruction (i.e., JMP NEXT as previously shown) must be included after the ENDDOinstruction to transfer program control to the first instruction past the end <strong>of</strong> the DO loop.Condition Codes:15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0I"F I DM I T I ** I 81 I 80 I " I 10 I 8 I l I E I U N I zOpcode:23 16 15 8 7 o10 0 0 0 0 0 0 o 10 0 0 0 0 0 0 0 11 o 0 0 1 1 0 01Instruction Fields:NoneTiming: 2 oscillator clock cyclesMemory: 1 program word