Maxim-integrated MAXQ622 Bedienungsanleitung Seite 50

  • Herunterladen
  • Zu meinen Handbüchern hinzufügen
  • Drucken
  • Seite
    / 255
  • Inhaltsverzeichnis
  • LESEZEICHEN
  • Bewertet. / 5. Basierend auf Kundenbewertungen
Seitenansicht 49
MAXQ612/MAXQ622 Users Guide
3-14 Maxim Integrated
When the supplied loop address is outside the relative jump range, the prefix register (PFX[0]) is used to supply the
high byte of the loop address as required.
move LC[1], #10h ; loop 16 times
LoopTop: ; loop addr not relative to djnz LC[n],src
call LoopSub
...
djnz LC[1], LoopTop ; decrement LC[1] and jump if nonzero
; assembles to: move PFX[0], #high(LoopTop)
; djnz LC[1], #low(LoopTop)
If loop execution speed is critical and a relative jump cannot be used, one might consider preloading an internal 16-bit
register with the src loop address for the “DJNZ LC[n], src” loop. This ensures that the prefix register does not need to
supply the loop address and always yields the fastest execution of the DJNZ instruction.
move LC[0], #LoopTop ; using LC[0] as address holding register
; assembles to: move PFX[0], #high(LoopTop)
; move LC[0], #low(LoopTop)
move LC[1], #10h ; loop 16 times
...
LoopTop: ; loop address not relative to djnz LC[n],src
call LoopSub
...
djnz LC[1], LC[0] ; decrement LC[1] and jump if nonzero
If opting to preload the loop address to an internal 16-bit register, the most time and code efficient means is by per-
forming the load in the instruction just prior to the top of the loop:
move LC[1], #10h ; Set loop counter to 16
move LC[0], IP ; Set loop address to the next address
LoopTop: ; loop addr not relative to djnz LC[n],src
...
3.7.6 Conditional Returns
Similar to the conditional jumps, the MAXQ612/MAXQ622 microcontrollers also support a set of conditional return
operations. Based upon the value of one of the status flags, the CPU can conditionally pop the stack and begin execu-
tion at the address popped from the stack. If the condition is not true, the conditional return instruction does not pop
the stack and does not change the instruction pointer. The following conditional return operations are supported:
RET C ; if C=1, a RET is executed
RET NC ; if C=0, a RET is executed
RET Z ; if Z=1 (Acc=00h), a RET is executed
RET NZ ; if Z=0 (Acc<>00h), a RET is executed
RET S ; if S=1, a RET is executed
Seitenansicht 49
1 2 ... 45 46 47 48 49 50 51 52 53 54 55 ... 254 255

Kommentare zu diesen Handbüchern

Keine Kommentare