STOP

Check if key/stop key is pressed
Function AddressVectorDescription
STOP FFE10328Check if key/stop key is pressed

This routine checks for either the RUN/STOP key or certain other keys are pressed.

Check for RUN/STOP key pressed

If the key was pressed during a UDTIM call, this call returns the z flag set. In addition, the channels will be reset to default values.

Example:
Check for STOP key pressed
JSRUDTIMUpdate timer which also scans for STOP
JSRSTOP
BNEstopNotDown
JMPstopDownJump to code to handle STOP
stopNotDownContinue further processing

In the above example if the STOP key is pressed we jump to the method stopDown. This method could reset your application, cancelling some lengthy operation.

Check for other keys

If the stop key is not pressed then the z flag will be clear and the accumulator will be set to one of the following keys located on the same keyboard column as the stop key:

C64 key Accumulator Vic-20 key Accumulator
1 0xFE Cursor Down 0x7F
Left arrow 0xFD / 0xBF
CTRL 0xFB , 0xDF
2 0xF7 N 0xEF
Space 0xEF V 0xF7
Commodore 0xDF X 0xFB
Q 0xBF Left Shift 0xFD

If no key is down in the STOP column, the routine returns 0xFF on both machines.