1
0
mirror of https://gitlab.com/camelot/kickc.git synced 2025-01-02 20:29:38 +00:00

Fine tune of the phi-far-4 example to clearly illustrate #pragma near_seg utilization.

This commit is contained in:
Flight_Control 2022-11-19 08:19:18 +01:00
parent d7a135aaee
commit d19c005d79

View File

@ -1,11 +1,7 @@
// Test a far call procedure with a calling convention sp
// Test a far call procedure with a calling convention phi
char* const SCREEN = (char*)0x0400;
void main(void) {
SCREEN[0] = plus('0', 7);
}
#pragma code_seg(stage)
#pragma far_seg(stage, 20)
@ -15,18 +11,7 @@ char plus(char a, char b) {
#pragma near_seg
void stage_entry() {
asm {
lda 0
pha
lda #1
sta 0
}
void main(void) {
SCREEN[0] = plus('0', 7);
}
void stage_exit() {
asm {
pla
sta 0
}
}