prog8/examples/test.p8

32 lines
639 B
Plaintext
Raw Normal View History

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