[Prev] [Next] [Contents] [Commodore] [New] [Search] [Home]

B-25. Function Name: SCNKEY

Purpose: Scan the keyboard
Call address: $FF9F (hex) 65439 (decimal)
Communication registers: None
Preparatory routines: IOINIT
Error returns: None
Stack requirements: 5
Registers affected: A, X, Y

Description: This routine scans the Commodore 64 keyboard and checks 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. This routine is called only if the normal IRQ interrupt is bypassed.

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-26. Function Name: SCREEN

Purpose: Return screen format
Call address: $FFED (hex) 65517 (decimal)
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., 40 columns in X and 25 lines in Y. The routine can be used to determine what machine a program is running on. This function has been implemented on the Commodore 64 to help upward compatibility of your programs.

How to Use:

  1. Call this routine.

EXAMPLE:

   JSR SCREEN
   STX MAXCOL
   STY MAXROW

[Prev] [Next] [Contents] [Commodore] [New] [Search] [Home]
This page has been created by Sami Rautiainen.
Read the small print. Last updated December 17, 2002.