User`s manual

174 digi.com Using Assembly Language
If separate I&D space is enabled, db places bytes in the base segment of the data space when it is used
with const. If the const keyword is absent, i.e.,
the bytes are placed somewhere in the instruction space. If separate I&D space is disabled (the default con-
dition), the bytes are placed in the base segment (aka, root segment) interspersed with code.
Therefore, so that data will be treated as data when referenced in assembly code, the const keyword
must be used when separate I&D space is enabled. For example, this won't work correctly without const:
The assembly language keyword dw defines 16-bit words, least significant byte first. The keyword dw
should be followed immediately by numerical values:
This example defines three constants. The first two constants are literals, and the third constant is the
address of variable xyz.
The numerical values initialize sequential word locations, starting at the current code address.
#asm
myrootconstants::
db 0x40, 0x41, 0x42
#endasm
#asm const
label::
db 0x5a
#endasm
main(){
;
#asm
ld a,(label) // ld 0x5a to reg a
#endasm
}
dw 0x0123, 0xFFFF, xyz