14
BIOS Serial Data Transmission INT Services Presented by NIKHIL N PATHAK (ME-MSA-207) M.S.UNIVERSITY,VADODARA 2010-2011

BIOS Serial Data Transmission INT Services

Embed Size (px)

DESCRIPTION

interrupt servive 14h

Citation preview

Page 1: BIOS Serial Data Transmission INT Services

BIOS Serial Data Transmission INT

Services

Presented by

NIKHIL N PATHAK(ME-MSA-207)

M.S.UNIVERSITY,VADODARA2010-2011

Page 2: BIOS Serial Data Transmission INT Services

BIOS Interrupt Services

o How does an interrupt work?

Page 3: BIOS Serial Data Transmission INT Services

BIOS Interrupt services(cont.)

o Types of Interrupts

o Vector Table

o BIOS INT Services

Page 4: BIOS Serial Data Transmission 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

Page 5: BIOS Serial Data Transmission INT Services

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.

Page 6: BIOS Serial Data Transmission INT Services

Serial port Initialization Function code (00h):

Setting parameters necessary for communication

ParameterBit Dec Hex  Description0 1 01h  Word Size   10 = 7

                   11 = 81 2 02h

2 4 04h Stop Bits   0 = 1 stop bit                 1 = 2 stop bits

3 8 08h  Parity      00 = None                01 = Odd                11 = Even

4 16 10h

5 32 20h  Baud Rate   000 = 110 baud                  001 = 150 baud                  010 = 300 baud                  011 = 600 baud                  100 = 1200 baud                  101 = 2400 baud                  110 = 4800 baud                  111 = 9600 baud

6 64 40h

7 128 80h

Page 7: BIOS Serial Data Transmission INT Services

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

Page 8: BIOS Serial Data Transmission INT Services

Data transmissionfunction code (01h)

oFunction code is loaded in AH register.

oThe character to be transmitted is loaded in AL register

Page 9: BIOS Serial Data Transmission INT Services

Data ReceiverFunction code (02h)

o The AH register is loaded with function code 02h.

o After execution the received character is stored in AL register.

Page 10: BIOS Serial Data Transmission INT Services

Get StatusFunction code (03h)

o Load AH with Function code 03h

o On execution ,the status of modem and RS-232 are loaded onto AX register

Page 11: BIOS Serial Data Transmission INT Services

Get StatusFunction code (03h) conti.

o BIOS Serial port Status , returned in AH

o BIOS Modem port Status , returned in AL

Page 12: BIOS Serial Data Transmission INT Services

Program code for transmitter.data

string1 'N','I','K','H','I','L'.code.startup

mov ax,@data ;Data segment initializationmov ds,axmov dx,0000h ;comport 1 selectionmov cx,06h ;load string lenghtmov AH,ooh ;function code for initializationmov AL,0E7h ;parameter set upint 14h ;bios interrupt call

Loop1: lea si,string1 ;load effective address of stringmov AH,01h ;function code for transmittingmov AL,[si]int 14hinc siloop loop1

.end

Page 13: BIOS Serial Data Transmission INT Services

Program code for receiver .data

string2 db 6dup(?).code.startup

mov ax,@data ;Data segment initializationmov ds,axmov dx,0000h ;comport 1 selectionmov ah,00h ;function code for initializationmov al,0E7h ;parameter set upint 14h ;bios interrupt callmov cx,06h

l2: mov ah,02hlea di,string2 ;load effective address of string2int 14hmov[di],al ;the received character is copied to inc di ;destination addressloop l2

end

Page 14: BIOS Serial Data Transmission INT Services

QUESTIONS ?

Thank You