BIOS Serial Data
Transmission INT
Services
Presented by
NIKHIL N PATHAK
(ME-MSA-207)
M.S.UNIVERSITY,VADODARA
2010-2011
BIOS Interrupt Services
o How does an interrupt work?
BIOS Interrupt services(cont.)
o Types of Interrupts
o Vector Table
o BIOS INT Services
Serial Data Transmission INT
Service (INT 14 h)
o Initialization of interrupt
Invoking an interrupt can be done using the INT
x86 assembly instruction. For example, to execute any
function using BIOS interrupt 14h we perform the
following x86 assembly instructions:
mov ah, ‘function code’
mov al, '!'
int 14h
Routines for communicating via the
serial port.
CODE DESCRIPTION
00h Serial Port Initialization
01h Transmit Character
02h Receive Character
03h Status
Note:- The code is loaded in AH.
Serial port Initialization
Function code (00h):
Setting parameters necessary for communication
Parameter
Bit Dec Hex Description
0 1 01h Word Size 10 = 7
1 2 02h 11 = 8
Stop Bits 0 = 1 stop bit
2 4 04h
1 = 2 stop bits
3 8 08h Parity 00 = None
4 16 10h
01 = Odd
11 = Even
5 32 20h
Baud Rate 000 = 110 baud
6 64 40h
001 = 150 baud
010 = 300 baud
011 = 600 baud
7 128 80h
100 = 1200 baud
101 = 2400 baud
110 = 4800 baud
111 = 9600 baud
Serial port Initialization
Function code (00h)(conti)
o Accordingly the parameter is selected and loaded in AL
register
o The Function code is loaded in AH register
Data transmission
function code (01h)
oFunction code is loaded in AH register.
oThe character to be transmitted is loaded in AL
register
Data Receiver
Function code (02h)
o The AH register is loaded with function code 02h.
o After execution the received character is stored in
AL register.
Get Status
Function code (03h)
o Load AH with Function code 03h
o On execution ,the status of modem and RS-232
are loaded onto AX register
Get Status
Function code (03h) conti.
o BIOS Serial port Status , returned in AH
o BIOS Modem port Status , returned in AL
Program code for transmitter
.data
string1 'N','I','K','H','I','L'
.code
.startup
mov ax,@data ;Data segment initialization
mov ds,ax
mov dx,0000h ;comport 1 selection
mov cx,06h ;load string lenght
mov AH,ooh ;function code for initialization
mov AL,0E7h ;parameter set up
int 14h ;bios interrupt call
Loop1: lea si,string1 ;load effective address of string
mov AH,01h ;function code for transmitting
mov AL,[si]
int 14h
inc si
loop loop1
.end
Program code for receiver
.data
string2 db 6dup(?)
.code
.startup
mov ax,@data ;Data segment initialization
mov ds,ax
mov dx,0000h ;comport 1 selection
mov ah,00h ;function code for initialization
mov al,0E7h ;parameter set up
int 14h ;bios interrupt call
mov cx,06h
l2: mov ah,02h
lea di,string2 ;load effective address of string2
int 14h
mov[di],al ;the received character is copied to
inc di ;destination address
loop l2
end
QUESTIONS
?
Thank You