13.07.2015 Views

Turbo Basic

Turbo Basic

Turbo Basic

SHOW MORE
SHOW LESS
  • No tags were found...

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

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

OUT statementFunctionSyntaxRemarksExampleOUT writes to an I/O port.OUT portno,integer expressionOUT sends a byte value (0 to 255) to hardware output port portno,where portno is an integer expression from 0 to 65,535.OUT is necessary for controlling various hardware subsystems~such as a communications or video adapter. Used improperly, OUTcan easily crash a system.IIIIThe program makes the' speaker shriekby reading the status register andtoggling (on and off) the bitsthat control the speaker.I read value in port 61 HexStatusReg% = INP(&H61)StatusReg% = StatusReg% AND &HOOFCI mask the value read inI make the tone long enough to hearFOR J = 1 to 1000StatusReg% = StatusReg% XOR 2 I toggle speakerOUT &H61,StatusReg%I output new statusdelay .001NEXT JEND<strong>Turbo</strong> <strong>Basic</strong> Reference Directory 289

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

Saved successfully!

Ooh no, something went wrong!