hi, Let assume that one .asm file contains next definitions:
PUBLIC FLAG1,FLAG2 FLAG1 EQU 00000001b FLAG2 EQU 00000010b
MOV A,#(FLAG1 OR FLAG2)
hi, because the assembler didn't know the value of such an expression, during its pass through the code Well, I see it clean, but what is about next: First file:
PUBLIC XBUF ?XD?XBUF SEGMENT XDATA RSEG ?XD?XBUF XBUF: DS 1024
EXTRN XDATA(XBUF) MOV A,#(LOW(XBUF) + 1) ; line 1 MOV A,#(LOW(XBUF) OR 1) ; line 2
Both statements in the second file contain references that are external. This means that they are resolved by the linker. The linker can resolve externals and some simple mathematical operations (typically + and -). However, more sophisticated operations are not supported by the linker (actually they are not supported by the OMF since this is how the assembler and compiler pass this information to the linker). In line 1,
MOV A,#(LOW(XBUF) + 1) ; line 1
MOV A,#(LOW(XBUF) OR 1) ; line 2
MOV A,#LOW(XBUF) ORL A,#1