When I use exx or ex af,af in an peep-file I get the below error. It doesn't seem to be a problem since it does the substitution and compiles correctly.
I think this should be removed/resolved since it is not correct, at least from the programmer's perspective. It works and it is correct Z80 assembler.
z80MightRead unknown asm inst line: exx
/// GPL 2.0 or later
#include <stdio.h>
#include <stdint.h>
#include <stdbool.h>
#include <stdlib.h>
int another_one(int a) { return a + 2; }
void do_something(int a) {
int count = 3;
do {
a = another_one(a);
} while( --count );
}
void main() {
do_something(3);
}
# This is just an example to show the error, not a typical use case
replace {
push bc
call _another_one
ex de, hl
pop bc
} by {
exx
call _another_one
exx
ex de, hl
}
sdcc -mz80 --peep-file peep.txt ./asm_noise.c -o asm_noise.ihx
I can reproduce the issue using the current next branch, and have a fix prepared that I'm now testing.
Fixed in the next branch in [r16604]. While I don't consider this important enough to delay SDCC 4.6.0 RC2,, [bugs:#4007] and [bugs:#4008] might be, if we delay RC2 for fixing those, we could also get the fix for this issue into RC2.
Related
Bugs:
#4007Bugs:
#4008Commit: [r16604]
The next branch has been merged to trunk, and the fix is in SDCC 4.6.0 RC2.