432 Line 40 of the example program could therefore be re-written as: .start LDA #129 \load accumulator with OSBYTE number or as .start LDA#129\load accumulator with OSBYTE number (Here, the label .start would have no fuction, but would not affect the processing.) Addressing modes Most assembly language instructions require data to work on, which must be provided in the operand field of the assembly language statement. Often, this data is an address. The assembler allows several different methods of providing these addresses or data to be used, these methods being known as addressing modes .
Not all assembly language instructions can use all the addressing modes; see the table in the appendix for more details. Implicit addressing This is the simplest form of addressing, which does not require an address to be supplied at all; the address is implied by the instruction itself. For example an RTS instruction (see line 80 above) always causes the processor to jump to the bottom two bytes of the stack, which contain the return address to the main program. Immediate addressing and zero page addressing LDA #129 Line 40 of the example is which means ‘load the accumulator with decimal 129’ (hexadecimal 29 could be loaded by the statement LDA #&29 ).
Here the statement uses the data supplied in the operand field without having to look for it in memory, hence the name ‘immediate addressing’. The data can be supplied as a variable, hence LDX #value would load the X register with the value of the variable value . The role of the # character in the above examples is important, since it indicates to the assembler that immediate addressing is to be employed, using the data supplied immediately to the right of the # . The instruction LDA 129 means something quite different; it means ‘load the accumulator with the contents of memory location 129’. The computer’s main memory is divided into