1
0
mirror of https://github.com/RevCurtisP/C02.git synced 2025-02-16 14:30:33 +00:00
C02/include/py65min.a02

43 lines
1.2 KiB
Plaintext
Raw Normal View History

2018-02-13 19:55:25 -05:00
; py65mon program initialization code for c02 programs
;System Specific ASCII Key Mappings
2018-08-14 14:14:32 -04:00
DELKEY EQU $08 ;Delete/Backspace Key (Delete)
2018-02-13 19:55:25 -05:00
ESCKEY EQU $1B ;Escape/Stop Key (Escape)
RTNKEY EQU $0D ;Return/Enter Key (Carriage Return)
;Memory Mapped I/O
2018-08-14 14:14:32 -04:00
PUTCON EQU $F001 ;Write Character to Console
GETCON EQU $F004 ;Read Character from Console
2018-02-13 19:55:25 -05:00
ORG $0200 ;Start Directly Above Stack
START: JMP MAIN ;Execute Program
2018-08-14 14:14:32 -04:00
;Delete Previous Character
DELCHR: JSR DELCHB ;Print Backspace
LDA #$20 ;Load Space into Accumulater
2018-11-07 00:11:09 -05:00
JSR PUTCHR ; and Print it
2018-08-14 14:14:32 -04:00
DELCHB: LDA #$08 ;Load Backspace into Accumulator
2018-11-07 00:11:09 -05:00
BNE PUTCHR ; and Print it
2018-08-14 14:14:32 -04:00
;Advance Character to Next line
NEWLIN: LDA #$0D ;Load C/R into Accumulator
2018-11-07 00:11:09 -05:00
JSR PUTCHR ; and Print it
2018-08-14 14:14:32 -04:00
LDA #$0A ;Load L/F into Accumulater
; and fall into PRCHR
;Print Character to Console
2018-11-07 00:11:09 -05:00
PUTCHR STA PUTCON ;Write Character to Console
2018-02-13 19:55:25 -05:00
RTS
2018-08-14 14:14:32 -04:00
;Poll Keyboard for Keypress
PLKEY: LDA GETCON ;Read Character from Console
RTS
;Wait for Character from Console
2018-11-07 00:11:09 -05:00
GETCHR: JSR POLKEY ;Read Character from Console
BEQ GETCHR ; Loop if None Received
2018-02-13 19:55:25 -05:00
RTS
EXIT: BRK ;Return to Monitor