0% found this document useful (0 votes)
18 views10 pages

Microprocessorlabreport 8086

This document discusses DOS functions and interrupts in 8086 assembly language. It provides examples of using INT 21H DOS functions for input, output, and string handling. It also includes sample programs and output to demonstrate using these concepts.

Uploaded by

Bipul Dahal
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)
18 views10 pages

Microprocessorlabreport 8086

This document discusses DOS functions and interrupts in 8086 assembly language. It provides examples of using INT 21H DOS functions for input, output, and string handling. It also includes sample programs and output to demonstrate using these concepts.

Uploaded by

Bipul Dahal
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/ 10

Tribhuvan University

Institute of Engineering
Thapathali Campus, Thapathali

Subject: Microprocessor
LAB #5

Submitted by:
Name:Bipul Kumar Dahal
Roll No.: THA078BEI009

Submitted to:
Department of Electronics and Computer Engineering

Date: 3rd March, 2023


Objective :
To be familiar with DOS function and interrupt in 8086.
Theory:

The Intel CPU recognizes two types of interrupts namely


hardware interrupt when a peripheral devices needs attention
from the CPU and software interrupt that is call to a subroutine
located in the operating system. The common software
interrupts used here are INT 10H for video
services and INT 21H for DOS services.
INT 21H:
It is called the DOS function call for keyboard operations follow
the function number. The service functions are listed below:
# 00H
- It terminates the current program.
- Generally not used, function 4CH is used instead.

# 01H- Read a character with echo


- Wait for a character if buffer is empty
- Character read is returned in AL in ASCII value

# 02H- Display single character


- Sends the characters in DL to display
- MOV AH, 02H
- MOV DL, ‘A’ ; move Dl, 65
- INT 21H

# 03H and 04H – Auxiliary input/output


- INT 14H is preferred.

# 05H – Printer service


- Sends the character in DL to printer

# 06H- Direct keyboard and display


- Displays the character in DL.
# 07H- waits for a character from standard input

# 08H- keyboard input without echo


- Same as function 01H but not echoed.

# 09H- string display


- Displays string until ‘$’ is reached.
- DX should have the address of the string to be displayed.

# 0AH – Read string


# OBH- Check keyboard status
- Returns FF in AL if input character is available in keyboard
buffer.
- Returns 00 if not.

# 0CH- Clear keyboard buffer and invoke input functions such


as 01, 06, 07, 08 or 0A.
- AL will contain the input function.

# 01H
MOV, AH 01H; request keyboard input INT 21H
- Returns character in AL. IF AL= nonzero value, operation
echoes on the screen. If Al=
zero means that user has pressed an extended function key such
as F1 OR home.

# 02H
MOV AH, 02H; request display character
MOV DL, CHAR; character to display
INT 21H
- Display character in D2 at current cursor position. The tab,
carriage return and line feed
characters act normally and the operation automatically
advances the cursor.
# 09H
MOV Ah, 09H; request display
LEA DX, CUST_MSG; local address of prompt
INNT 21H
CUST_MSG DB “Hello world”, ‘$’
- Displays string in the data area, immediately followed by a
dollar sign ($ or 24H), which
uses to end the display.
Program:
1. Write a program to print Programming is Fun with carriage
return.

Programming
Is
Fun

Program:
Output:
2. Write a program to print Programming is Fun without
carriage return.

Programming
Is
Fun

Program:
Output:
3. Write Assembly level program to print Hello World with
different color text in different background.

Program:

Output:
Discussion and Conclusion:

This report has demonstrated the usefulness of DOS functions


and interrupts in 8086 assembly language programming. We
showed how interrupts can be used to transfer control to
different parts of the system, and how DOS functions can be
used to perform a variety of tasks, such as reading and writing
Strings.

Our sample program demonstrated the practical application of


these concepts, by reading a String and outputting to the console.
Although we encountered some challenges during development,
we were able to successfully execute the program and obtain the
desired output.

Overall, we believe that DOS functions and interrupts can be a


valuable tool for assembly language programmers, providing a
way to interact with the operating system and perform complex
tasks. We hope that this report has provided a useful
introduction to these concepts, and that readers will be inspired
to explore them further in their own programming projects.

You might also like