I'm curently starting to learn Z80 assembly language and I have the following snipet of code :
LD A, 53H
LD B, F5H
ADD A, B
halt
It simply loads two immediates into the registers A and B, and adds them up.
The problem I have is with the sencond line containing LD B, F5H
.
The assembler is complaining about undefined variable: F5H Line: 2
with one assembler and Invalid argument of the instruction
using a different assembler.
Can someone explain what syntax error I'm doing here? the first line compiles with no errors.
Strangely, using the interactive assembly writer, doing LD B, 0F5H
seems to fix the error, whereas in the first line, writing either LD B, F5H
orLD B, 0F5H
is fine, and both generate the same object code.
From the Z80 manual :
Upon the execution of an LD E, A5h instruction, Register E contains A5h.
Thanks in advance.