How to access undocumented z80-instructions in SDCC (sdasz80)?

Page 2/2
1 |

By Bengalack

Hero (578)

Bengalack's picture

22-05-2022, 21:46

Good news! Philipp Klaus Krause just informed me that using the later snapshot builds allows the use of the command line parameter:

--allow-undocumented-instructions

and it works. I just found my generated asm having iyh and iyl.

As for what is supported I quote:

Quote:

SDCC will use any undocumented instruction that is an official instruction in the eZ80 to access iyl and iyh.
sdasz80 / inline asm allow more.

Note: Official 4.2 is not recent enough.

By aoineko

Champion (444)

aoineko's picture

22-05-2022, 22:04

What a timing! I just added Pletter support to MSXgl yesterday and ran into the problem of undocumented instruction support.
In the code, I replaced these instructions by their equivalent in raw data, but I left them as comments... just in case. ^^
Even if I personally won't use undocumented instructions, it is still useful to include third party code.
I hope they will add a pragma to enable this option only on some source code.

By aoineko

Champion (444)

aoineko's picture

12-06-2022, 19:10

@Bengalack I can't found information about how to use undocumented instructions with SDCC.
I guess --allow-undocumented-instructions is a command line parameter for SDCC and concerns the assembly code generated from the C sources.
However, I did not find how to use it with sdasz80 and/or with the inline assembler.

.z80
.allow_undocumented

...generates an error.

PS: I got the last snapshot (build 13495).

By geijoenr

Champion (311)

geijoenr's picture

12-06-2022, 19:43

I had the same problem, if you use .z180 instead of .z80 it does work.

By Bengalack

Hero (578)

Bengalack's picture

12-06-2022, 23:48

I use .allow_undocumented (only) in the asm-file with sdasz80 without problems. But for c-code, I use the command-line-parameter (and "-mz80"). I guess the functionality is so new, it didn't reach the documentation yet.

By gdx

Enlighted (5491)

gdx's picture

13-06-2022, 02:17

aoineko wrote:

I guess --allow-undocumented-instructions is a command line parameter for SDCC and concerns the assembly code generated from the C sources.

It would be weird if it were otherwise. And in the parts in assembler, SDCC should just tell us that we are using undocumented instructions.

By aoineko

Champion (444)

aoineko's picture

13-06-2022, 23:45

With the last SDCC snapshot, I got an error (Error: .org in REL area or directive / mnemonic error) even if I use only .allow_undocumented... :-/

By ARTRAG

Enlighted (6843)

ARTRAG's picture

14-06-2022, 22:30

Use the command line option

By aoineko

Champion (444)

aoineko's picture

15-06-2022, 00:15

Command line option is for the C compiler (my assembler code is assembled with sdasz80).
For now, I converted the unsupported opcode to binary data.

By ARTRAG

Enlighted (6843)

ARTRAG's picture

15-06-2022, 20:24

In the assembler .z180 should work

Page 2/2
1 |