Download BBC Microcomputer Advanced User Guide
Transcript
5.11 Relative addressing The 6502 instruction set contains 8 branch instructions which cause a jump if a certain condition is met. In the example above a BNE instruction is used to cause the loop to be executed again if the loop index (Y register) does not equal 0. These branch instructions can only be used with relative addressing. If the condition of the branch is satisfied the byte following the branch instruction is added to the program counter as an 8 bit two's complement number. This method of relative addressing allows a branch forward 127 bytes or back 128 bytes from the program counter value after the branch instruction has been executed. The calculation of the relative branch value is normally quite transparent to the programmer using the BASIC assembler. When writing in assembly language the programmer follows the branch instruction with a label or absolute address and the assembler performs the necessary calculations. The use of relative addressing will only become apparent when a label or absolute address is specified outside the relative addressing range. When this occurs the assembler will flag an ‘Out of range’ error to the user. OPT 0 is used to suppress this error from forward references on the first assembler pass. 40
Related documents
ACORN COMPUTERS LTD. ACW 443 SERVICE MANUAL
THE BBC MICROCOMPUTER IEEE488 INTERFACE USER GUIDE
March 1980 - Nascom / Gemini / 80 Bus
*FX/OSbyte features not documented in the BBC Micro User Guide
User Guide - Intelligent Interfaces
RetroClinic DataCentre Manual
DataCentre-E - RetroClinic.com
Service Manual
Disc Filing System User Guide
ATPL Sidewise manual - Retro-kit
Acorn Engineering News Issue 1 April 1987
Manuale della distribuzione in rete