prog8/examples/test.p8

32 lines
639 B
Plaintext
Raw Normal View History

2024-10-27 21:50:48 +01:00
%import textio
%zeropage basicsafe
%option no_sysinit
2024-10-18 22:22:34 +02:00
main {
ubyte bank
romsub @bank bank $a000 = routine_in_hiram(uword arg @AY) -> uword @AY
2024-11-05 00:15:40 +01: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-05 00:15:40 +01:00
txt.nl()
}
asmsub the_increment_routine(uword arg @AY) -> uword @AY {
%asm {{
clc
adc #1
bcc +
iny
+ rts
}}
}
}