I’m trying to use A86 to assemble some code for 8086. I narrowed my problem down to 4 lines of code.
MOV BX, testz
ADD AL, [testz]
INT 20h
testz:
~ ^
#ERROR 16: Definition Conflicts With Forward Reference @@@@#
db ?
What do you think is wrong with this code? I am moving the address itself to BX register and adding the byte-value in the testz address to AL.
In a bigger program I also get #ERROR 13: Byte/Word Combination Not Allowed.
But label is a word where [label] is a byte. Why can’t my compiler differentiate between those?
ADD BL, [second]
MOV BX, second
~ ^
#ERROR 13: Byte/Word Combination Not Allowed
second:
~ ^
#ERROR 16: Definition Conflicts With Forward Reference @@@@#
db ?
Because I can’t see any Byte/Word conflict.
My compiler interprets offset testz and testz equally.
I looked at the bytecodes and couldn’t see any difference.
MOV BX, testz
ADD AL, [BX]
The code above works, but is there any other way that I can do this in one line like
ADD AL, [testz]
Whenever I put a label name in [], it is just not acceptable according to my compiler a86. But I feel they are allowed in the language.
I suspect you want
MOV BX, offset testz. It appears that your assembler interprets[testz]andtestzto mean the same thing.You might confirm this by trying instead the notionally equivalent
LEA BX, testzEDIT: (from http://www.csn.ul.ie/~darkstar/assembler/manual/a14.txt):