void put_mem(u8 pg, u16 addr, u8 data)
{
//addr=32768+nn
_asm
//pg
ld a,4 (ix)
xor #0x7f
ld bc,#0xbff7
ld (_MEMSLOT2),a
out (c),a
//addr
ld l,5 (ix)
ld h,6 (ix)
//data
ld a,7 (ix)
ld (hl),a
ld a,#0x71
out (c),a
_endasm;
}


u8 get_mem(u8 pg, u16 addr)
{
//addr=32768+nn
_asm
//pg
ld a,4 (ix)
xor #0x7f
ld bc,#0xbff7
ld (_MEMSLOT2),a
out (c),a
//addr
ld l,5 (ix)
ld h,6 (ix)
//data
ld l,(hl)
ld a,#0x71
out (c),a
_endasm;
} 