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:
parent
d7a135aaee
commit
d19c005d79
@ -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
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user