Using inline asm I can use certain istructions with iyh/iyl/ixh/ixl registers but I can't use some others.
For instance no problems with
__asm
ld iyl,iyh
ld iyh,iyl
dec iyl
dec ixl
__endasm;
but this would break (example):
__asm
ld a,iyh
ld ixl,a
__endasm;
I suspect this is just a bug.
Thanks for fixing it!
I realized now I have filed this under 'Support Requests'.
Should I file this again under 'Bugs' or can you move that?
Thanks! (Sorry!)
Ticket moved from /p/sdcc/support-requests/186/
Can't be converted:
The bug here is that the instructions
ld iyl,iyh,ld iyh,iyl,dec iylanddec ixldo not give such an error.What would be the correct equivalent of these instructions?
None. The syntax is correct, the undocumented instructions are just not valid instructions for the z80 target by default.
To enable them, a target that has them enabled by default has to be used (
-mez80_z80or-mzxn), or for-mz80, the option--allow-undocumented-instructions.Note however, that doing so will not just enable them for inline assembly, it will also allow the compiler to use them.
To enable them for inline assembly only, but still disallow their use by the compiler (e.g. to ensure that only some of them are used - AFAIK on some early NMOS Z80, some of the undocumented instructions don't work ), one could use
-mz80without--allow-undocumented-instructionsand enable the undocumented instructions for the assembler only via the assembler directive:Last edit: Philipp Klaus Krause 2023-04-13
OK so I see I should be able to use the
.allow_undocumentedinstruction and then assembleld a,iyhand/orld ixl,a?I will try.
Not these ones, AFAIK...
.allow_undocumentedis broken until Commit: [r13287](just a note to myself for later)
Related
Commit: [r13287]
Last edit: sverx 2023-04-14
Fixed in [r14011],
Related
Commit: [r14011]