Problems with using z80 IX and IY registers

  • Anonymous

    Anonymous - 2012-07-12

    I am currently writing a op code test file for an open core z80 processor, but I am having some problem compiling my code using the sdcc. For example,  testing ADD A, (IX + 5) I receive an error "missing or improper operators, terminators or delimiters". I have also tried ADD A, (IX + 5H)   ADD A, (IX + 0x05)   ADD A, (IX + #0x05)   and a couple of other variation but have had no luck. Does anybody know how to perform this action? I assume I just have the syntax wrong.

  • José Bray

    José Bray - 2012-09-16

    Hello Heather

    You just have to use the following syntax:
    add A,5(IX)
    or even
    add 5(IX)

    You can find this indication in the ASxxx Cross Assembler Documentation (html version) under the paragraph M.3:

    offset(ix) indexed addressing with an offset

    Have fun with the Z80!



Log in to post a comment.