ebmDevMag.com home
ebm Developer's Magazine
links

developer's mag
main page

article
part 1
part 2
part 3
part 4
part 5
part 6
part 7
part 8
part 9


7 - Branching Codes

For branch instructions, the result of a successful test is a branch to the current address plus one, plus the value contained in the t register. In the case of a jump or subroutine call, the value is calculated identically. Note that because of the K flag, a ldt must be performed immediately before any conditional branching instruction for it to be interpreted as such.

beq bge bgeu; bcs bgt
Branch if equal to zero (the Z flag was set). Branch if greater than or equal - comparison of the sign flag and the overflow flag. Branch if greater than or equal (unsigned) or branch if carry set. Test of C flag. Branch if greater than. Similar to bge, except that zero is considered a test failure.
bgtu ble bleu blt
Branch if greater than (for unsigned values). Branch if less than or equal. Branch if less than or equal (for unsigned values). Branch if less than.
bltu; bcc bmi bne bpl
Branch if less than (unsigned) or C flag cleared, which are equivalent. Branch if minus (S flag set). Branch if not equal. Branch if plus (positive).
bra bsr bvc bvs
Branch always (unconditionally). Branch to subroutine - as with other branch instructions, the t value is added to the current position, plus one. Branch if no overflow (V clear). Branch if V set.
jmp (t) jsr (t)
Jump to the location specified by the t register. Perform a subroutine jump to the location specified by the t register.


Previous Section
Next Section

Copyright © 2001-2006 ebmDevMag.com - Legal Notice