1
0
mirror of https://gitlab.com/camelot/kickc.git synced 2025-08-07 06:30:04 +00:00
Files
kickc/src/test/kc/call-banked-phi-case-4-near-1.c
Sven Van de Velde f2bf3484ad - testing and regeneration of fragment references
- implementation of near, close, far through AsmFragmentSignature
- fragment consolidation (removal of prepare, execute, finalize)
- stackcall banked throws error + test cases
- overall test cases for phi
- implementation of fragments
2023-04-11 08:35:53 +02:00

26 lines
485 B
C

// Test a procedure with calling convention PHI - case #4
#pragma link("call-banked-phi.ld")
char* const SCREEN = (char*)0x0400;
#pragma code_seg(Code)
void main(void) {
SCREEN[0] = plus('0', 7); // close call
}
#pragma code_seg(RAM_Bank1)
#pragma bank(cx16_ram, 1)
char plus(char a, char b) {
return min(a, b); // near call
}
#pragma code_seg(RAM_Bank1)
#pragma bank(cx16_ram, 1)
char min(char a, char b) {
return a+b;
}
#pragma code_seg(Code)
#pragma nobank(dummy)