Hi
The attached code for Z80 is not compiled correctly. The first result of two successive io port reads is discarded. The io ports are not treated as volatile (also when volatile keyword is put before the sfr declaration).
SDCC : z80/ez80_z80 3.8.6 #10937 (Linux)
Thank You
Fixed in [r10960].
Philipp