Question from Philip Molter

How can I specify a negative integer in the program? I had a line like 'ntenfr equ -10000' but it would only put in the Hex value for 10000 when it assembled the code. When I put in the Hex value for -10000 (instead of the number itself) which is D8F0h, the assembler returned an error. Does the assembler/program not handle negative 16-bit integers?

ANSWER from mdwagh:

One shortcoming of the A80 assembler is that it cannot process unary minus operation correctly. Thus it will wrongly assemble the following statement:

mvi a, -20

However, it can correctly deal with binary minus operation. Thus it will correctly assemble

mvi a, 3-23

or even

mvi a, 0-23

Obviously, one should therefore avoid using unary minus sign in the assembly programs being assembled with A80.

Note that all hex numbers must begin with a digit to be interpreted as numbers. Any string that begins with a letter is considered by the assembler as the name of a variable. Thus valid hex numbers are: 0ab5h. 35ch, 0ffffh etc. Thus a statement

mvi a, ffh ; put 255 in register A

will be flagged as an error, but

mvi a, 0ffh ; put 255 in register A

will correctly assemble.