2019-04-10 10:04:41 +00:00
|
|
|
static unsigned char val;
|
|
|
|
|
|
|
|
static void foo(void) {
|
2019-04-30 16:21:13 +00:00
|
|
|
val = 5;
|
2019-04-10 10:04:41 +00:00
|
|
|
}
|
|
|
|
|
2019-04-14 16:45:53 +00:00
|
|
|
static void wrap(void) {
|
2019-04-10 10:04:41 +00:00
|
|
|
|
2019-04-30 16:21:13 +00:00
|
|
|
asm("lda #<%v", foo);
|
|
|
|
asm("ldx #>%v", foo);
|
|
|
|
asm("jmp callax");
|
2019-04-10 10:04:41 +00:00
|
|
|
|
|
|
|
}
|
|
|
|
|
2019-04-14 16:45:53 +00:00
|
|
|
int main(void) {
|
2019-04-10 10:04:41 +00:00
|
|
|
|
2019-04-30 16:21:13 +00:00
|
|
|
val = 0;
|
|
|
|
wrap();
|
2019-04-10 10:04:41 +00:00
|
|
|
|
2019-04-30 16:21:13 +00:00
|
|
|
return val == 5 ? 0 : 1;
|
2019-04-10 10:04:41 +00:00
|
|
|
}
|