Commodore VIC-20 Programmer's Reference Manual page 209

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

Advertisement

access the memory mapped I/O devices in the VIC, The offset will
be 1he number of locations from the beginning of the page that the
desired I/O register is located. The .X register will contain the fow
order address byte, while the .Y register will contain the high order
address byte.
This routine exists to provide compatibility between the VIC 20
and future models of the VIC. IF the I/O locations for a machine
language program are set by a call to this routine, they should still
remain compatible with future versions of the VIC, the KERNAL and
BASIC.
How to use:
1)
Call this routine by using the JSR instruction,
2)
Store the ,X and the .Y registers in consecutive locations.
3)
Load the .Y register with the offset.
4)
Access that I/O location.
EXAMPLE:
; Set the data direction register of the user port to 0 (input)
1)
JSR IOBASE
2}
STX POINT
;set base registers
STYPQINT+1
3)
LDY #2
4)
LDA #0
;offset for DDR of the user port
STA (POINT)Y
;Set DDR to 0
B-12. Function name: LISTEN
Purpose: Command a device to LISTEN
Call Address: SFFB1
Communication registers: ,A
Preparatory routines: None
Error returns: See READST
Stack requirements: None
Registers affected: ,A
Description; This routine will command a device on the serial
bus to receive data. The accumulator must be loaded with a device
number between 4 and 31 before calling the routine. LISTEN will
OR the number bit by bit to convert to a listen address, then transmit
this data as a command on the serial bus. The specified device will
then go into listen mode, and be ready to accept information.
How to use:
1)
Load the accumulator with the number of the device to
command to LISTEN.
2)
Call this routine using the JSR instruction.
193

Hide quick links:

Advertisement

Table of Contents
loading

Table of Contents