An absolute section is defined using the ORG directive. In that case, the Macro Assembler generates a pseudo section, whose name is "ORG_<index>", where index is an integer which is incremented each time an absolute section is encountered, as listed in the following listing:
ORG $800 ; Absolute data section. var: DS. 1 ORG $A00 ; Absolute constant data section. cst1: DC.B $A6 cst2: DC.B $BC
In the previous portion of code, the label cst1 is located at address $A00, and label cst2 is located at address $A01.
1 1 ORG $800 2 2 a000800 var: DS.B 1 3 3 ORG $A00 4 4 a000A00 A6 cst1: DC.B $A6 5 5 a000A01 BC cst2: DC.B $BC
Locate program assembly source code in a separate absolute section, as listed in the following listing:
XDEF entry ORG $C00 ; Absolute code section. entry: LDA cst1 ; Load value in cst1 ADD cst2 ; Add value in cst2 STA var ; Store in var BRA entry
In the portion of assembly code above, the LDA instruction is located at address $C00, and the ADD instruction is at address $C03. See the following listing:.
8 8 ORG $C00 ; Absolute code 9 9 entry: 10 10 a000C00 C6 0A00 LDA cst1 ; Load value 11 11 a000C03 CB 0A01 ADD cst2 ; Add value 12 12 a000C06 C7 0800 STA var ; Store in var 13 13 a000C09 20F5 BRA entry 14 14
In order to avoid problems during linking or execution from an application, an assembly file should at least: