Menu

Z80 sdasz80 use of .allow_undocumented directive

2016-11-07
2016-11-08
  • Andreas Ziermann

    The .allow_undocumented allows the use of the IYL registers, like LD A,IYL. But looking into the code there seems a problem. The directive only works for .z180 targets. But except the opcode cycle table, there is no direct depedency to the .z180 target.

    It seems like a bug or at least not intentional. The statement before the switch will not allow the use of undocumented instructions. How does the compiler can make use of it?

    z90mch:
         #define X_Z80 0  -> mchtyp
        #define X_HD64 1 -> mchtyp 
        #define S_CPU 83  -> rf
        #define X_UNDOCD 89 ->rf
    
            if (!mchtyp && rf>S_CPU) //remove???
                    rf = 0;
            switch (rf)
    

    Would it be possible to allow undocumented instruction also for Z80 Targets and remove that line?

     

    Last edit: Andreas Ziermann 2016-11-07
  • Philipp Klaus Krause

    I suggest to file feature request or bug report.

    Philipp

     
  • Andreas Ziermann

    Thanks so far. The second part of the question was about the compiler. There was a discussion before to make use of those opcode during compilation. Especially one opcode JMP (IY) seems meaningful.
    How far is the discussion about using those opcode?

     
  • Philipp Klaus Krause

    SDCC does use jp (iy), but it is not an undocumented opcode.

    Philipp

     

Log in to post a comment.