Technical information

Using NewBIOS Serial Solutions
Example 2, Sending Data Out.__________________________
In this example service 1H is used to send character nextch
to COM2. The example examines the values returned by the
service to check that the character has been sent correctly.
record /regtype/ registers
character nextch /’a’/
C Example 2, Send nextch to COM1
C service 1, send character
registers.ah = 16#1
C character to send
registers.al = ichar(nextch)
C COM2
registers.dx = 1
call intrpt (16#14, registers )
if( (registers.ah .AND. 16#80) .NE. 0 )then
write (*,*) ’COM2 timed out on output.’
stop
end if
Example 3, Setting Port Addresses.______________________________
This example uses service ADH to set the i/o addresses of
COM3 and COM4, it also checks for the presence of NewBIOS.
This service is only available through NewBIOS.
record /regtype/ registers
integer*2 com3addr/16#3220/, com4addr/16#3228/
C Example 3,set COM3 and COM4 addresses
C service AD, set port
registers.ah = 16#AD
C i/o address
registers.bx = com3addr
C COM3
registers.dx = 2
call intrpt (16#14, registers )
if( registers.ax .NE. 16#52ad )then
write (*,*) ’NewBIOS not installed!’
Chapter 4 Page 65