User Tools

Site Tools


spo600:6502_jumps_branches_and_subroutines

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Next revision
Previous revision
spo600:6502_jumps_branches_and_subroutines [2024/01/12 20:07] – created chrisspo600:6502_jumps_branches_and_subroutines [2024/04/16 18:10] (current) – external edit 127.0.0.1
Line 25: Line 25:
 Branches are conditional on the state of a [[6502#Registers|processor flag]]. The destination of the branch is given as a signed byte relative to the current value of the [[6502#Registers|PC]], so the destination must be within -128 to +127 bytes of the byte after the branch instruction. These are the branch instructions available: Branches are conditional on the state of a [[6502#Registers|processor flag]]. The destination of the branch is given as a signed byte relative to the current value of the [[6502#Registers|PC]], so the destination must be within -128 to +127 bytes of the byte after the branch instruction. These are the branch instructions available:
  
-  BCC ; Branch on Carry flag ('''C''') Clear +  BCC ; Branch on Carry flag (C) Clear 
-  BCS ; Branch on Carry flag ('''C''') Set  +  BCS ; Branch on Carry flag (C) Set  
-  BEQ ; Branch on EQual (zero '''Z''' flag set) +  BEQ ; Branch on EQual (zero Z flag set) 
-  BNE ; Branch on Not Equal (zero '''Z''' flag clear) +  BNE ; Branch on Not Equal (zero Z flag clear) 
-  BMI ; Branch on MInus (negative flag '''S/N''' set) +  BMI ; Branch on MInus (negative flag N set) 
-  BPL ; Branch on PLus (negative flag '''S/N''' clear) +  BPL ; Branch on PLus (negative flag N clear) 
-  BVC ; Branch on oVerflow flag '''V''' Clear +  BVC ; Branch on oVerflow flag V Clear 
-  BVS ; Branch on oVerflow flag '''V''' Set+  BVS ; Branch on oVerflow flag V Set
  
 In assembler, you typically specify the address or label to which you wish to branch, and the assembler calculates the relative value for the branch offset. In assembler, you typically specify the address or label to which you wish to branch, and the assembler calculates the relative value for the branch offset.
spo600/6502_jumps_branches_and_subroutines.1705090055.txt.gz · Last modified: 2024/04/16 18:10 (external edit)

Donate Powered by PHP Valid HTML5 Valid CSS Driven by DokuWiki