Thanks, I'm playing with msxpen.com and I have simple question: what's the different between ld a,200 and ld a,#200? The latter is used in the disassembly I'm converting. msxpen.com accepts both notations with different results.
Ld a,200 loads a from memory address 200 (extended addressing), and ld a #200 loads the numeric value 200 into a (immediate addressing).
Motorola assembly is the same way.
#200 is hex, same as 0x200
200 is decimal
#200 is not hex, it is decimal.
Hex is represented by the prefix $ on Motorola chips, and H postfix on the Z80, upper or lower case H h usually works depending on the assembler.
So when combined with my previous comment, ld a,200h would be load a from address 200 hex, and ld a,#200h would be load value 200 hex into a
Not only that, but a is 8 bit on the Z80 and loading a value larger than 8 bits into a should cause the assembler to generate an error
0x200 notation for hex is supported by most modern assemblers but I can't vouch for old ones.
Since this is about porting code, you just have to be aware of both forms as would a translator program.
Edited by JamesD, Mon Jul 3, 2017 9:54 AM.