Learn how easy it is to sync an existing GitHub or Google Code repo to a SourceForge project! See Demo

Close

Problems with using z80 IX and IY registers

Anonymous
2012-07-12
2013-03-12

  • Anonymous
    2012-07-12

    Hi,
    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.
    Thanks

     
  • 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!

    José