2024-10-27 20:50:48 +00:00
|
|
|
%import textio
|
|
|
|
%zeropage basicsafe
|
2024-11-05 22:56:58 +00:00
|
|
|
%option no_sysinit
|
2024-10-18 20:22:34 +00:00
|
|
|
|
2024-11-04 03:28:27 +00:00
|
|
|
main {
|
2024-11-05 22:56:58 +00:00
|
|
|
ubyte bank
|
|
|
|
|
2024-11-06 21:14:53 +00:00
|
|
|
extsub @bank bank $a000 = routine_in_hiram(uword arg @AY) -> uword @AY
|
2024-11-05 22:56:58 +00:00
|
|
|
|
2024-11-04 23:15:40 +00:00
|
|
|
sub start() {
|
2024-11-05 22:56:58 +00:00
|
|
|
; copy the routine into hiram bank 8
|
|
|
|
bank = 8
|
|
|
|
cx16.rambank(bank)
|
|
|
|
sys.memcopy(&the_increment_routine, $a000, 255)
|
|
|
|
cx16.rambank(1)
|
2024-11-04 22:26:21 +00:00
|
|
|
|
2024-11-05 22:56:58 +00:00
|
|
|
txt.print("incremented by one=")
|
|
|
|
txt.print_uw(routine_in_hiram(37119))
|
2024-11-04 23:15:40 +00:00
|
|
|
txt.nl()
|
2024-11-04 22:26:21 +00:00
|
|
|
}
|
|
|
|
|
2024-11-05 22:56:58 +00:00
|
|
|
asmsub the_increment_routine(uword arg @AY) -> uword @AY {
|
|
|
|
%asm {{
|
|
|
|
clc
|
|
|
|
adc #1
|
|
|
|
bcc +
|
|
|
|
iny
|
|
|
|
+ rts
|
|
|
|
}}
|
|
|
|
}
|
|
|
|
}
|