1
0
mirror of https://github.com/RevCurtisP/C02.git synced 2024-11-15 17:08:51 +00:00
C02/include/py65min.a02
2018-08-14 14:14:32 -04:00

43 lines
1.2 KiB
Plaintext

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