17.07.2013 Views

GWBASIC User's Manual

GWBASIC User's Manual

GWBASIC User's Manual

SHOW MORE
SHOW LESS

You also want an ePaper? Increase the reach of your titles

YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.

GW-BASIC <strong>User's</strong> Guide<br />

INP Function<br />

Purpose:<br />

To return the byte read from machine port n.<br />

Syntax:<br />

INP(n)<br />

Comments:<br />

n represents a valid machine port number within the range of 0 to 65535.<br />

The INP function is one way in which a peripheral device may communicate with a GW-BASIC<br />

program.<br />

INP is the complementary function to the OUT statement.<br />

Examples:<br />

100 A=INP(56)<br />

Upon execution, variable A contains the value present on port 56. The number returned will be<br />

within the range of 0 to 255, decimal.<br />

The assembly language equivalent to this statement is<br />

MOV DX,56<br />

IN AL,DX<br />

file:///C|/Documents%20and%20Settings/Lorenzo/Desktop/GW%20Basic/INP.html28/03/2004 21.29.30

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!