as: M68HC11-Modifiers
1
1 9.24.3 Symbolic Operand Modifiers
1 ---------------------------------
1
1 The assembler supports several modifiers when using symbol addresses in
1 68HC11 and 68HC12 instruction operands. The general syntax is the
1 following:
1
1 %modifier(symbol)
1
1 '%addr'
1 This modifier indicates to the assembler and linker to use the
1 16-bit physical address corresponding to the symbol. This is
1 intended to be used on memory window systems to map a symbol in the
1 memory bank window. If the symbol is in a memory expansion part,
1 the physical address corresponds to the symbol address within the
1 memory bank window. If the symbol is not in a memory expansion
1 part, this is the symbol address (using or not using the %addr
1 modifier has no effect in that case).
1
1 '%page'
1 This modifier indicates to use the memory page number corresponding
1 to the symbol. If the symbol is in a memory expansion part, its
1 page number is computed by the linker as a number used to map the
1 page containing the symbol in the memory bank window. If the
1 symbol is not in a memory expansion part, the page number is 0.
1
1 '%hi'
1 This modifier indicates to use the 8-bit high part of the physical
1 address of the symbol.
1
1 '%lo'
1 This modifier indicates to use the 8-bit low part of the physical
1 address of the symbol.
1
1 For example a 68HC12 call to a function 'foo_example' stored in
1 memory expansion part could be written as follows:
1
1 call %addr(foo_example),%page(foo_example)
1
1 and this is equivalent to
1
1 call foo_example
1
1 And for 68HC11 it could be written as follows:
1
1 ldab #%page(foo_example)
1 stab _page_switch
1 jsr %addr(foo_example)
1