Really simple question. Reading
this it seems that branch instructions index off of the next instruction. For instance:
Code:
LABEL INA ; lets say our label address is 0000 for simplicity
BRA LABEL ; Here we'll be branching to the previous line, so -1 from the current address, but -3 from the next address.
When assembled, would BRA LABEL be BRA -1 or BRA -3 (80 FF or 80 FD)?
The document I mentioned shows the case of:
Code:
LABEL BRA LABEL+2 ; 3 cycles
Now, if this were to assemble to BRA 0 we'd be on top of the next instruction, as it seems to imply, but if it assembles to BRA -2 since the label is 2 addresses behind the next instruction, we'd be infinite looping on our current instruction. Which way is correct?