Hi Everyone, I am trying to get the following to assemble, but the assembler gives me error A20:-
defins_XSEG segment xdata rseg defins_XSEG rx_buff: ds 200h tx_buff: ds 200h rx_msb EQU HIGH rx_buff rx_lsb EQU LOW rx_buff tx_msb EQU HIGH tx_buff tx_lsb EQU LOW tx_buff
Many thanks for your help I now have a solution and understand what was wrong! Again, Many Thanks Alex F
hi, the solution may be obtained with little trick - the usage of C directive #define:
#define rx_msb HIGH(rx_buff) #define rx_lsb LOW(rx_buff) #define tx_msb HIGH(tx_buff) #define tx_lsb LOW(tx_buff)
You are trying to define a symbol (using EQU) created from low and high bytes of the address of a variable, but those addresses are resolved by linker - so that's why this syntax does not work... - Dejan
(Meant 'shouldn't even try') Shouldn't post after a drink!
I should even try to answer this as I haven't used this assembler. But I suspect that this would work if you were actually producing code with your HIGH. But that to generate an intermediate symbol value will not work. Try to generate some assembler code which uses the 'HIGH rx_buff' as a value and see if that works.
View all questions in Keil forum