Technical information
Serial Solutions Using NewBIOS
5100 ASM%(I) = VAL("&H" + T$ + S$)
5110 TOT# = TOT# + ASM%(I)
5120 NEXT I
5130 :
5140 IF TOT# = -144845! THEN 5190
5150 PRINT "Bad machine code data, terminating."
5160 PRINT "Check data statements at line 5230-"
5170 END
5180 :
5190 RETURN
5200 :
5210 ’8086 machine code. Moves values in operands
5215 ’to chip registers, performs INT 14H, and
5220 ’copies the registers back to the variables.
5230 DATA 55 : ’PUSH BP
5240 DATA 8B,EC : ’MOV BP,SP
5250 DATA 8B,76,0C : ’MOV SI,[BP]+0CH
5260 DATA 8B,04 : ’MOV AX,[SI]
5270 DATA 8B,76,0A : ’MOV SI,[BP]+0AH
5280 DATA 8B,1C : ’MOV BX,[SI]
5290 DATA 8B,76,08 : ’MOV SI,[BP]+8
5300 DATA 8B,0C : ’MOV CX,[SI]
5310 DATA 8B,7E,06 : ’MOV DI,[BP]+6
5320 DATA 8B,15 : ’MOV DX,[DI]
5330 DATA CD,14 : ’INT 14h
5340 DATA 89,15 : ’MOV [DI],DX
5350 DATA 89,0C : ’MOV [SI],CX
5360 DATA 8B,76,0A : ’MOV SI,[BP]+0AH
5370 DATA 89,1C : ’MOV [si]+8,BX
5380 DATA 8B,76,0C : ’MOV SI,[BP]+0CH
5390 DATA 89,04 : ’MOV [si]+6,AX
5400 DATA 5D : ’POP BP
5410 DATA CA,08,00 : ’RETF 8
5420 DATA 00
The subroutine performs a check on the data to ensure that it is
correct. The text of these GW-BASIC examples is included with
the Serial Solutions software in the file ’GWTEST.BAS’.
Example 1, Initialising A Port.__________________________
This example uses service 0H to set the Baud rate etc for
COM1. A later chapter, "NewBIOS Reference", contains details
of this and all asynchronous services.
1000 ’GW-BASIC BIOS interface test program
1005 ’GW-BASIC code fragment to set COM1 to
1010 ’1200 Baud, even parity, 7 data bits
1015 ’and 1 stop bit.
Page 60 Chapter 4