mirror of
https://github.com/irmen/prog8.git
synced 2024-11-26 11:49:22 +00:00
52 lines
940 B
Plaintext
52 lines
940 B
Plaintext
%output basic
|
|
|
|
%import c64lib
|
|
|
|
~ main {
|
|
var .text name = "????????????????????????????????????????????????????????????????????????????????" ; 80
|
|
var .word orig_irq
|
|
|
|
start:
|
|
c64.init_system()
|
|
|
|
orig_irq = c64.CINV
|
|
SI = 1
|
|
c64.CINV = &irq_handler
|
|
SI = 0
|
|
|
|
|
|
c64scr.print_string("enter your name: ")
|
|
c64scr.input_chars(name)
|
|
c64.CHROUT('\n')
|
|
|
|
blop:
|
|
return
|
|
%breakpoint
|
|
return
|
|
|
|
; yeah!
|
|
|
|
c64scr.print_string("thank you, mr or mrs: ")
|
|
c64scr.print_string(name)
|
|
c64.CHROUT('\n')
|
|
|
|
SI = 1
|
|
c64.CINV = orig_irq
|
|
SI = 0
|
|
|
|
return
|
|
|
|
|
|
irq_handler:
|
|
%asm {
|
|
lda c64.SFDX
|
|
cmp #$40 ; nothing pressed?
|
|
beq +
|
|
inc c64.EXTCOL ; otherwise change color
|
|
+ jmp c64.IRQDFRT
|
|
}
|
|
|
|
|
|
|
|
}
|