Extended

The extended addressing mode is used to access memory location located above the direct page in a 64-kilobyte memory map.

For the extended instructions, three bytes are required: the first byte is the opcode and the second and the third bytes are the most and least significant bytes of the operand address. See the following listing for an example of the extended addressing mode.

Listing: Extended addressing mode
           XDEF  Entry
initStack: EQU   $0400

           ORG   $B00

data:      DS.B  1

MyCode:    SECTION

Entry:

           LDHX  #initStack ; init Stack Pointer

           TXS              ; with value $400-1 = $03FF

main:      LDA   #$55

           STA   data

           BRA   main

In this example, the value $55 is stored in the variable data. This variable is located at address $0B00 in the memory map. The opcode of the STAdata instruction is then three bytes long.