Commodore VIC-20 Programmer's Reference Manual page 217

Hide thumbs Also See for VIC-20:
Table of Contents

Advertisement

LDX VARTAB
;Load .X WITH LOW BYTE OF END OF SAVE
LDY VAR
TAB + 1
;
.Y WITH HIGH BYTE
LDA
#<TXTTAB
;LOAD ACCUMLATOR WITH PAGE 0 OFF
SET
JSR SAVE
B-22. Function name: SCNKEY
Purpose: Scan the keyboard
Call address: SFF9F
Com muni cation registers: None
Preparatory routines: None
Error returns; None
Stack requirements: None
Registers affected: .A, .Xt .Y
Description; This routine will scan the VIC keyboard and check
for pressed keys. It is the same routine called by the interrupt
handler. If a key is down, its ASCII value is placed in the keyboard
queue.
How to use;
1)
Call this routine
EXAMPLE:
GET
JSR SCNKEY
;SCAN KEYBOARD
JSR GETIN
;GET CHARACTER
CMP #0
;IS IT NULL?
BEQ GET
;YES, . .SCAN AGAIN
JSR CHROUT
;PRINT IT
B-23. Function name: SCREEN
Purpose: Return screen format
Call address: SFFED
Communication registers: X..Y
Preparatory routines: None
Stack requirements: 2
Registers affected: .X, .Y
Description: This routine returns the format of the screen, e.g.,
22 columns in ,X and 23 lines in ,Y. This routine can be used to
determine what machine a program is running on, and has been
implemented on the VIC to help upward compatibility in programs.
Mow to use:
1)
Call this routine.
EXAMPLE:
JSR SCREEN
201

Hide quick links:

Advertisement

Table of Contents
loading

Table of Contents