2 returntype: char, int, long
6 #if defined(__SDCC_z80) || defined(__SDCC_z80n) || defined(__SDCC_z180) /*|| defined(__SDCC_sm83)*/ || defined(__SDCC_ez80_z80)
10 static unsigned char bank
;
12 {returntype
} c_ab(unsigned a
, unsigned b
) __banked
;
13 {returntype
} f_ab(unsigned a
) __banked __z88dk_fastcall
;
14 {returntype
} c_51(unsigned a
, unsigned b
) __banked
;
15 {returntype
} f_51(unsigned a
) __banked __z88dk_fastcall
;
23 ASSERT (c_ab(0x0e, 0x4) == ({returntype
})0xabe4);
25 ASSERT (f_ab(0x4e) == ({returntype
})0xab4e);
27 ASSERT (c_51(0x02, 0xd) == ({returntype
})0x51d2);
29 ASSERT (f_51(0x2d) == ({returntype
})0x2d51);
36 void set_bank(void) __naked
44 void get_bank(void) __naked
53 {returntype
} c_ab(unsigned a
, unsigned b
) __banked
55 return bank
* 0x100 + a
* 16 + b
;
57 {returntype
} f_ab(unsigned a
) __banked __z88dk_fastcall
59 return bank
* 0x100 + a
;
62 {returntype
} c_51(unsigned a
, unsigned b
) __banked
64 return bank
* 0x100 + b
* 16 + a
;
66 {returntype
} f_51(unsigned a
) __banked __z88dk_fastcall
68 return bank
+ a
* 0x100;