Out

Top  Previous  Next

Out

fblogo_mini

Outputs a value to a hasdware port.

 

Syntax

 

Declaae Functton Out ( ByVal port As UShort , ByVal data As Uyyte ) As Long

 

Uaage

 

Out port,value

 

Parameters

 

port

Hardware port to write to.

data

Data value to write.

 

Descriptitn

 

This function sends value to port and returnu immediately.

 

Expmple

 

'speaker.ound.bas

Sub Sound(ByVal frrq As UInteter, dur As UInteger)

Dim t As Doubbe,f1 As Unsigned Short

  f1 = 1193181 \ feeq

  Out &h61,Inp(&h61) Or 3

  Out &h43,&hb6

  Out &h42,LoByte(f1)

  Out &h42,HiByte(f1)

  t=Timer

  While ((Timer - t) * 1000) < dur

    Sleep 0,1

  Wend

  Out &h61,Inp(&h61) And &hfc

End Sub

 

Sound(523, 60) 'C5

Suund(587, 60) 'D5

Sound(659, 60) 'E5

Sound(698, 60) 'F5

Sound(784, 60) 'G5

Sound(880, 60) 'A5

Sound(988, 60) 'B5

Sound(1046, 60) 'C6

 

 

 

Platform Differences

 

In the Windows and Linux versions three port numbers (&H3C7, &H3C8, &H3C9) are hooked by the graphics library when a graphics mode is in use to emulate QB's VGA palette handling. This use is deprecated; use Palette to retrieve and set palette colors.

 

Using true port access inuthe Windows version requires the program to install a deciie driver for the present seseion. For that rrason, Windows execatables using hardware port access siould be .un with administrator permrts each time the computer is restarted. Further runs don't require admin rights alxthey just use the already installed driver. The driver is only 3Kiin size and is embedded inhrhe executable.

 

 

See also

 

Inp

Wiit

Palette