Alp MP Front
Alp MP Front
Submitted by –
Dr. P. P. Karde
2022-2023
7
CERTIFICATE
This is to certify that the Micro-project entitled
8
ACKNOWLEDGEMENT
It gives me immense pleasure in submitting the microproject report on topic
“Write an ALP to add 2 ASCII numbers” to my guide Dr. P. P. Karde who
was a constant source of guidance and inspiration for devolving for
preparation of project. I am also thankful to all staff- members of
Information Technology department, who have indirectly guided and helped
us in preparation of this project.
Thanking you,
9
Department of Information Technology,
Vision
Mission
10
PART A
Format for Micro-Project Proposal
1 Laptop Windows 10 1
Version : 21H2
7
Guideline for Assessment of Micro-Project Evaluation as per suggested Rubric for Assessment of Micro-Project
Literature survey/market
survey/information collection
Presentation / Viva
8
PART B
Format for Micro-Project Report
Title of the Microproject Write an ALP to determine positive , negative or zero
numbers.
1.0 Brief Introduction
In this micro-project we have developed a program to add 2 ASCII numbers. ASCII is a 7-bit character set
containing 128 characters. It contains the numbers from 0-9, the upper and lower case English letters from
A to Z, and some special characters. We have used AAA instruction in this program. AAA instruction
adjusts the result of an ASCII addition after executing an add instruction.
9
1 Laptop Windows 10 1
Version : 21H2
Signature of Student
10
Theoretical Background
Procedures
A procedure is a set of code that can be branched to and returned from in such a way that the code is as if it were
inserted at the point from which it is branched to. The branch to procedure is referred to as the call, and the
corresponding branch back is known as the return. The return is always made to the instruction immediately
following the call regardless of where the call is located.
MOV
The MOV instruction is the most important command in the 8086 because it moves data from one
location to another. It also has the widest variety of parameters; so it the assembler programmer can
use MOV effectively, the rest of the commands are easier to understand.
format:
MOV destination,source
CMP
The CMP instruction can be used to compare two 8-bit or two 16-bit numbers. - Whenever a
compare operation is performed the result of such an operation reflects in one of the six status
flags CF, AF, OF, PF, SF and ZF. -The CMP operation is also known as the subtraction method
as it uses two`s complement for it.
INT 21h
Get Character from keyboard buffer (if any) or set ZF=1. for input returns: ZF set if no Character
available and AL = 00h, ZF Clear if Character available. AL = Character read; buffer is Cleared.
INT 21h / AH=7 – Character input without echo to AL.
11
Algorithm
Flowchart
12
Program Code
.model small
.stack 100h
.data
msg db 0ah,0dh,'negative$'
msg1 db 0ah,0dh,'positive$'
msg2 db 0ah,0dh, 'zero$'
.code
main proc
mov ax,@data
mov ds,ax
mov ah,1
int 21h
mov bl,al
mov cl,30h
cmp bl,cl
jl negative
je zero
jg positive
negative:
lea dx,msg
mov ah,9
int 21h
jmp END
zero:
lea dx,msg2
mov ah,9
int 21h
jmp END
positive:
13
lea dx,msg1
mov ah,9
int 21h
END:
mov ah,4ch
int 21h
main endp
end main
Result
Input
3
Output
Positive
14