Technical information
Serial Solutions Using NewBIOS
mov al,09AH ;09AH indicates the above parameters.
;later chapters contain details of
which
;values select which baud rates.
mov dx,0 ;dx selects the port 0= COM1
INT 14H ;Call asynchronous services.
;
;done
Before the INT 14H is executed the registers that send data
to the service are set.
Let us try a more elaborate example, one where the value
returned by the service is relevant.
Example 2, Sending Data Out.__________________________
This uses service 1H to send a character to COM2. It
examines the line status returned by the routine to see if the byte
was sent correctly.
;Code fragment to send the byte held in
;location ’nextchar’ COM2
;
mov ah,1 ;Send character, service 1H
mov al,nextchar ;Set al to the value in nextchar
;This value will be sent to COM2
mov dx,1 ;COM2
INT 14H ;Call asynchronous services.
;
;have attempted to send byte.
;If there is some problem service 1 will have
;timed out. It flags this by setting bit
;7 of the line status.
and ah,080H ;This sets bits 0 to 6 of AH to 0.
jnz outproblem ;If result is not zero (ie if bit 7
;was set) jump to ’outproblem’.
;
jmp done ;done
;
outproblem:
;code to deal with character not being sent here.
The values of the other bits in the line status recorded in AH are
detailed in later chapters.
Let us now try an example using the new services
provided by NewBIOS.
Page 48 Chapter 4