We need these for some of the systems that do I/O decoding on the cheap (like
the ZX spectrum). Not yet tested.
extern void out(uint8_t addr, uint8_t val);
extern uint8_t in(uint8_t addr) __z88dk_fastcall;
+/* This is an 8bit value to 16bit port - its defined as dual uint16_t to get
+ better code out of SDCC */
+extern void out16(uint16_t addr, uint16_t val);
+extern uint8_t in16(uint16_t addr) __z88dk_fastcall;
+
/* Z80 binaries start with a JP */
#define EMAGIC 0xc3 /* Header of executable */
#define EMAGIC_2 0x18 /* JR */
.globl ___hard_irqrestore
.globl _in
.globl _out
+ .globl _in16
+ .globl _out16
; imported symbols
.globl _chksigs
push de
jp (hl)
+_out16:
+ pop hl ; return
+ pop iy ; bank
+ pop bc ; port
+ pop de ; data
+ push de
+ push bc
+ push hl
+ push iy
+ out (c),e
+ jp (hl)
+
+_in16:
+ ld b,h
_in:
ld c,l
in l, (c)