I/O Port Access in QBasic

QBasic provides access to the I/O ports on the 80x86 CPU via the INP function and the OUT statement.

INP(portid) ' returns a byte read from the I/O port portid

OUT portid, value ' writes the byte value to the I/O port portid

portid can be any unsigned integer in the range 0-65535. value is in the range 0-255.

pdata   = &H378
status  = &H379
control = &H37A

OUT pdata, bits    ' output data

bits = INP(status) '  input data                                           

Here's my Digital Joystick example


[ Back to Reading & Writing Data ]


last updated: 13-Mar-97 Ian Harries <ih@doc.ic.ac.uk>