Apple II User Manual

Page of 257
DECREMENT:
     DCR Rn              [ Fn ]
     The contents of Rn are decremented by 1. The carry is cleared
     and other branch conditions reflect the decremented value.
     EXAMPLE:  (Clear 9 bytes beginning at location A034)
     15 34 A0           SET  R5   $A034     ;Init pointer
     14 09 00           SET  R4   9         ;Init counter
     B0                 SUB  R0             ;Zero ACC
     55         LOOP2   ST   @R5            ;Clear a mem byte
     F4                 DCR  R4             ;Decrement count
     07 FC              BNZ  LOOP2          ;Loop until Zero
Non-Register Instructions:
--------------------------
RETURN TO 6502 MODE:
     RTN 00
     Control is returned to the 6502 and program execution continues
     at the location immediately following the RTN instruction. the
     6502 registers and status conditions are restored to their
     original contents (prior to entering SWEET 16 mode).
BRANCH ALWAYS:
     BR ea               [ 01 d ]
     An effective address (ea) is calculated by adding the signed
     displacement byte (d) to the PC. The PC contains the address
     of the instruction immediately following the BR, or the address
     of the BR op plus 2. The displacement is a signed two's
     complement value from -128 to +127. Branch conditions are not
     changed.
     NOTE: The effective address calculation is identical to that
     for 6502 relative branches. The Hex add & Subtract features of
     the APPLE ][ monitor may be used to calculate displacements.
     d = $80  ea = PC + 2 - 128
     d = $81  ea = PC + 2 - 127
     d = $FF  ea = PC + 2 - 1
     d = $00  ea = PC + 2 + 0
     d = $01  ea = PC + 2 + 1
     d = $7E  ea = PC + 2 + 126
     d = $7F  ea = PC + 2 + 127
     EXAMPLE: