0

Is there some upper limit on how big a byte I can load into a z80 register?

Loading 9Fh works ok. Attempting to load A0h results in an assembler error message.

I'm using the z80asm assembler on linux.

    $ cat load-test.asm
    ld a, 9Fh   ;ok
    ld b, 9Fh   ;ok

    ld a, A0h  ;error
    ld b, A0h  ;error

    $ z80asm load-test.asm -o load-test.bin
    load-test.asm:6: error: unable to resolve reference: A0h  ;error
    load-test.asm:6: error: unable to resolve reference: A0h  ;error
    *** 2 errors found ***
    $ 
twisted
  • 742
  • 2
  • 11
  • 19
  • 6
    Numbers have to start with a digit. Prefix with a zero if your hex starts with a letter, otherwise the assembler will think it's a symbol. TL;DR: use `0A0h`. – Jester Feb 09 '20 at 17:16
  • Problem solved. Thanks Jester. Don't think I can mark a comment as providing the answer. – twisted Feb 09 '20 at 17:28
  • The duplicate is for masm/x86 but the answer applies. – Jester Feb 09 '20 at 17:52

0 Answers0