gbdk-2020 | GameBoy Development Kit |
| download: https://git.y1.nz/archives/gbdk.tar.gz | |
| README | Files | Log | Refs | LICENSE |
gbdk-lib/libc/targets/z80/gg/___sdcc_bcall_abc.s
1 .include "global.s"
2
3 .area _CODE
4
5 .globl ___sdcc_bcall_abc
6
7 ;
8 ; trampoline to call banked functions with __z88dk_fastcall calling convention
9 ; Usage:
10 ; ld a, #<function_bank>
11 ; ld bc, #<function>
12 ; call ___sdcc_bcall_abc
13 ;
14 ___sdcc_bcall_abc::
15 push hl
16 ld l, a
17 ld a, (#.MAP_FRAME1)
18 ld h, a
19 ld a, l
20 ld (#.MAP_FRAME1), a
21 ex (sp), hl
22 inc sp
23 call ___sdcc_bjump_abc
24 dec sp
25 pop bc
26 ld c, a
27 ld a, b
28 ld (#.MAP_FRAME1), a
29 ld a, c
30 ret
31 ;
32 ___sdcc_bjump_abc:
33 push bc
34 ret
This webpage is intended to be an accessible preview of this repository. To get a fuller picture, clone it and use the git CLI.