Extended Data Addressing Example

Consider the code of the following listing.

Listing: Addressing Extended Data
  move.w x:0x123456,A1    ; move int using 24 bit absolute address

  tst.l   x:(R0-0x123456) ; test a global long for zero using 24-bit pointer indexed

                          ; addressing

  move.l r0,x:(R0)+       ; r0 stored as 24-bit quantity

  cmpa r0,r1              ; compare pointer registers as 24 bit quantities  

The large data memory model is convenient because you can place data objects anywhere in the 24-bit data memory map. But the model is inefficient because extended data addressing requires more program memory and additional execution cycles.

However, all global and static data of many target applications easily fit within the 64 K word memory boundary. With this in mind, you can check the Globals live in lower memory checkbox of the M56800E Processor settings panel. This tells the compiler to access global and static data with 16-bit addresses, but to use 24-bit addressing for all pointer and stack operations. This arrangement combines the flexibility of the large data memory model with the efficiency of the small data model’s access to globals and statics.
Note: If you check the Globals live in lower memory checkbox, be sure to store data in lower memory.