0% found this document useful (0 votes)
134 views2 pages

Assembly Language Program - Part II: 1. BIOS Interrupt

This document discusses input/output interrupts in assembly language programs. It describes several BIOS interrupts for screen control including setting the cursor position and clearing the screen. It also outlines several I/O interrupts including reading a single character of input, outputting a character, outputting a string, and reading a string of input. The interrupts make function calls to manipulate the screen and handle input/output using interrupt codes and registers.

Uploaded by

black hello
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
134 views2 pages

Assembly Language Program - Part II: 1. BIOS Interrupt

This document discusses input/output interrupts in assembly language programs. It describes several BIOS interrupts for screen control including setting the cursor position and clearing the screen. It also outlines several I/O interrupts including reading a single character of input, outputting a character, outputting a string, and reading a string of input. The interrupts make function calls to manipulate the screen and handle input/output using interrupt codes and registers.

Uploaded by

black hello
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 2

BACS1024 Introduction to Computer Systems

Assembly Language Program - Part II


1. BIOS Interrupts
2. Input/Output Interrupts

1. BIOS Interrupt

1) Standard screen size


 Rows: 25 (Range from 0 - 24)
 Columns:80 (Range from 0 - 79)

2) Set cursor
 Function code: 02H
 Interrupt used: INT 10H
 E.g.:
MOV AH,02H ; set function (cursor)
MOV BH,00 ; set page number 0 (current page)
MOV DH, 08 ; set row 8
MOV DL,15 ; set column 15
INT 10H ; call interrupt service

3) Clear screen
 Function code: 02H
 Interrupt used: INT 10H
 E.g.:
MOV AX,0600H ; AH = 06 = set function (clear screen)
; AL= 00 = line # to scroll /
; 00 (full screen)
MOV BH,71H ; attribute (color)set page number 0
; 7 = white background &
; 1 = blue foreground
MOV CX,0000H ; set start row:column
; = upper left row:column
MOV DX,174FH ; set start row:column
; = lower right row:column
INT 10H ; call interrupt service

2. I/O Interrupts

1) Input byte
 Function code: 01H
 Interrupt used: INT 21H
 E.g.:
MOV AH,01H ; request input char
; input char to be stored in AL
INT 21H ; call interrupt service

2) Input byte (for password)


 Function code: 07H
 Interrupt used: INT 21H

1
BACS1024 Introduction to Computer Systems

 E.g.:
MOV AH,07H ; request input char
; input char to be stored in AL
INT 21H ; call interrupt service

3) Output byte
 Function code: 02H
 Interrupt used: INT 21H
 E.g.:
MOV AH,02H ; request display char
MOV DL,61H ; char to display 61h = ASCII “a”
INT 21H ; call interrupt service

4) Newline & carriage return


 Function code: 02H
 Interrupt used: INT 21H
 E.g.:
MOV AH,02H ; request display char
MOV DL,0DH ; carriage return
INT 21H ; call interrupt service
MOV DL,0AH ; Line feed
INT 21H ; call interrupt service

5) Output string
 Function code: 09H
 Interrupt used: INT 21H
 E.g.:
.DATA
Msg DB “Hello world!$” ; define data item / variable
.CODE
MOV AH,09H ; request display string
LEA DX,Msg ; load effective / start address
INT 21H ; call interrupt service

6) Input string
 Function code: 0AH
 Interrupt used: INT 21H
 E.g.:
.DATA
ARRAY LABEL BYTE ; name
MAX DB 20 ; max length
ACT DB ? ; actual length
ARRAYDATA DB 20 DUP (‘’) ; data area
.CODE
MOV AH,0AH ; request input string
LEA DX,ARRAY ; load effective address
INT 21H ; call interrupt service

You might also like