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