Technical information

Using NewBIOS Serial Solutions
Example 3, Setting Port Addresses.______________________________
Service ADH sets the address of a port. Suppose that a
second dual serial card has been added to the the machine giving
COM3 and COM4. The BIOS must be told of its existence.
;Code fragment to set the addresses
;of COM3 and COM4.
;
mov ah, 0ADH ;Set port address
mov dx, 2 ;COM3
mov bx,com3addr ;address in i/o map of
;chip for COM3
INT 14H ;asynchronous services.
cmp ax,052ADH ;This number is the flag
;returned by the service
;to say that it is here.
jne biosproblem ;If not set then NewBIOS
;not installed
mov ah, 0ADH ;Set port address
mov dx, 3 ;COM4
mov bx,com4addr ;address of chip for COM4
INT 14H ;do it.
jmp done ;done
;
;
biosproblem:
;code to deal with problem of NewBIOS not being present.
;E.g. print error message and halt.
Microsoft C And QuickC._______________________
C is a powerful language with a wealth of facilities for
both constructing high-level programs and controlling the
machines on which they run. Microsoft C programs running on
MS-DOS machines have a quite straightforward access to the
machine’s BIOS interrupts.
C provides several functions which access the machine
interrupt routines. The most useful for NewBIOS is ’int86()’,
defined as:
int int86(int n, union REGS *inregs, union REGS *outregs);
where ’REGS’ are
struct WORDREGS {
Chapter 4 Page 49