mirror of
https://gitlab.com/camelot/kickc.git
synced 2025-08-07 06:30:04 +00:00
- 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
26 lines
485 B
C
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)
|