0% found this document useful (0 votes)
180 views

EENG410 Microprocessors I

This document contains summaries of 5 experiments conducted using assembly language programming: 1. A program that multiplies two hexadecimal numbers using iterative addition in a loop. The student learned how to use loops and offsets to perform multiplication. 2. A program that finds the lowest value in an array of numbers using comparison and jumping instructions in a loop. The student learned how to use comparison, jumping, and loops to find minimum values. 3. A program that solves a mathematical formula by performing addition, multiplication, division and calculating remainders. The student learned how to perform various arithmetic operations. 4. A program that converts uppercase letters to lowercase and vice versa in a string. The student learned how to convert between
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)
180 views

EENG410 Microprocessors I

This document contains summaries of 5 experiments conducted using assembly language programming: 1. A program that multiplies two hexadecimal numbers using iterative addition in a loop. The student learned how to use loops and offsets to perform multiplication. 2. A program that finds the lowest value in an array of numbers using comparison and jumping instructions in a loop. The student learned how to use comparison, jumping, and loops to find minimum values. 3. A program that solves a mathematical formula by performing addition, multiplication, division and calculating remainders. The student learned how to perform various arithmetic operations. 4. A program that converts uppercase letters to lowercase and vice versa in a string. The student learned how to convert between
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/ 12

Southeast University

Course: Microprocessor Design and Assembly Language Programming Lab


Course Code: CSE 3014
Section: 51
Submitted By
SARWER HUSSAIN FAISAL
ID: 2011000500067
DEPT: EEE
BATCH: 4TH
Exp. Number: 01
Name of the program
A program that uses ADD command to do the multiplication of 12H and 7H.
(Hint: Multiplication can be performed by iterative addition)
Objective
Learning how to multiply two hexa-decimal number by using ADD command
(iterative addition) and how to use loop function.
PROGRAM
.MODEL SMALL
.STACK 64H
.DATA
X DW 12H
Y DW 7H
MULTIFICATION DW ?
.CODE
MAIN: MOV AX,@DATA
MOV DS,AX
MOV BX,OFFSET X
MOV AX,Y
MOV CX,Y
MOV AX,00
ALOOP: ADD AX,[BX]
DEC CX
JNZ ALOOP
MOV MULTIFICATION,AX
MOV AH,4CH
INT 21H
END MAIN
OUTPUT
MULTIFICATION: 007EH
DISCUSSION
First I was thinking how to use loop and to use offset of x
Then I was thinking about counter cx
Last of all, I took a jump instruction (JNZ) for cx
Then I got my result
Conclusion
From that experiment, I have learned about multification by iterative addition
using loop.
Exp. Number: 02
Name of the program
An assembly program that finds the lowest value in the following array of
numbers: GRADES DB 19H, 93H, 69H, 55H, 99H
Program
.MODEL SMALL
.STACK 64H
.DATA
GRADES DB 19H, 93H, 69H, 55H, 99H
LOWEST DB ?
.CODE
MAIN: MOV AX,@DATA
MOV DS, AX
MOV BX, OFFSET GRADES
MOV CX, 05
YELLOW: MOV AL, [BX]
GREEN: CMP [BX], AL
JB YELLOW
INC BX
LOOP GREEN
MOV LOWEST, AL
MOV AH, 4CH
INT 21H
END MAIN
Output
LOWEST: 19H
DISCUSSION
First I was thinking how to use loop and to use offset of grades
Then I was thinking about counter cx
Last of all, I took a CMP & jump instruction (JB)
Then I got my result
Conclusion
From that experiment, I have learned how to find out lowest number, use CMP &
loop.
Exp. Number: 03
Name of the program
A program that finds the result of the following formula. Check the program for
the given value and write down your obtained results as well.
X1= 3, X2=6, X3=9
Objective
Learning how to add, multiply & divide between numbers and how to solve any
equation
Program
.MODEL SMALL
. STACK 64H
.DATA
X1 DB 3
X2 DB 6
X3 DB 9
A DB ? ;A=X1*X2
B DB ? ;B=X2*X3
C DB ? ;C=X3*X2
D DB ? ;D=X1+X2+X3
E DB ? ;E=A+B+C
F DB ? ;ANS
G DB ? ;REMINDER
.CODE
MAIN: MOV AX,@DATA
MOV DS,AX
MOV AL,X1
MUL X2
MOV A,AL
MOV AL,X2
MUL X3
MOV B,AL
MOV AL,X3
MUL X1
MOV C,AL
MOV AL,X1
ADD AL,X2
ADD AL,X3
MOV D,AL
MOV AL,A
ADD AL, B
ADD AL, C
MOV E,AL
MOV AL,E
DIV D
MOV F,AL
MOV G,AH
MOV AH,4CH
INT 21H
END MAIN
OUTPUT
F=05H
G =09H
DISCUSSION
First I was thinking how to separate every part of the equation
Then I was thinking about output
Which part of output will go higher byte and which part go lower byte
And what would be if I use 16 bit register
Then I got my result
Conclusion
From that experiment, I have learned how to solve an equation.
Exp. Number: 04
Name of the program
A program to change the following name to lowercase and, the surname into
uppercase. AlBeRt EiNsTeIn
Objective
Learning how to convert upper case letter to lower case letter and lower case
letter to upper case letter.
Program
.DATA
MIXED DB 'AlBErT EnSTEIN'
F DB 14 DUP(?)
L DB 14 DUP ?
.CODE
MAIN: MOV AX,@DATA
MOV DS,AX
MOV SI,OFFSET MIXED
MOV BX,OFFSET F
MOV CX,8
BACK: MOV AL,[SI]
CMP AL,41H
JB OVER
CMP AL,5AH
JA OVER
add AL,20H
OVER: MOV [BX],AL
INC SI
INC BX
LOOP BACK
MOV SI,OFFSET MIXED
MOV BX,OFFSET L
MOV CX,14
BACK1: MOV AL,[SI+7]
CMP AL,61H
JB OVER1
CMP AL,7AH
JA OVER1
SUB AL,20H
OVER1: MOV [BX],AL
INC SI
INC BX
LOOP BACK1
MOV AH,4CH
INT 21H
END MAIN
Output
DISCUSSION
This was really so hard program for me but after doing this program I feel
good
First I was concerned about separating two parts of the name AlBeRt
EiNsTeIn.
Then I put first name in one place and surname in other place
Then I use counter and loop
For higher case ,I used SUB AL,20H and for lower case I used ADD
AL,20H
Then I got my result
Conclusion
From that experiment, I have learned about conversion of letter
Exp. Number: 05
Name of the program
A program that it will read some numbers from the keyboard, if we input a
random number then corresponding message should be the output from the
following messages:
If the number <50 fail
If the number >50 and <60 satisfactory
If the number >60 and <70 good
If the number >70 and <80 very good
If the number >80 and < 99 excellent
Objective
Learning how to display massage and take input from keyboard and use that data
for logical function.
Program
Output
If the number <50 fail
If the number >50 and <60 satisfactory
If the number >60 and <70 good
If the number >70 and <80 very good
If the number >80 and < 99 excellent
DISCUSSION
This is so interesting program
First I was concerned about taking input from keyboard.
After taking input from keyboard ,I stored them and I used them for my
logical function
Then I used counter and loop
Then I got my result
Conclusion
From that experiment, I have learned about displaying massage and taking input
from keyboard and use them for logical function.

You might also like