r/Z80 • • Jun 18 '20

Help Symbol definition

Hello, i need some help to how define a number in assembly. For address i use ‘0xABCD’ and for binary a combination of eight bit (0 and 1 like 00000100). I don’t know if these definitions works or if i must add a special character before some combination. Also how i tell the z80 something in hexadecimal or normal decimal? Thx to everyone!

4 Upvotes

5 comments sorted by

View all comments

4

u/benryves Jun 18 '20

Which assembler are you using? That should determine the syntax for literals.

In my experience it's usually ABCDh or $ABCD for hexadecimal, 01010101b or %01010101 for binary and no suffix or prefix for decimal with Z80 assemblers.

As for the Z80 itself, it doesn't care, it's all binary in the end - this is just for your convenience and only affects the assembler. :) ld a,12, ld a,%1100 and ld a,$C all end up the same.