1
0
mirror of https://github.com/RevCurtisP/C02.git synced 2024-06-08 21:29:30 +00:00
C02/include/py65min.a02

43 lines
1.2 KiB
Plaintext
Raw Normal View History

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