Professional Documents
Culture Documents
Green University of Bangladesh Department of Computer Science and Engineering (CSE)
Green University of Bangladesh Department of Computer Science and Engineering (CSE)
LAB REPORT NO # 01
Course Title: Microprocessor and Microcontroller Lab
Lab Experiment Name: a)Take a character input from user, check whether the
given character is vowel or not (a,e,i,o,u).
b)Take a number n from user. After that find out the factorial of that number n.
(Suppose for n=5, you have to find out factorial= 1 * 2 * 3 *4 * 5.
____________________________
S tudent Details
Name ID
1.
2. Md. Shahin Sarker 193002060
3.
[For Teachers use only: Don’t Write Anything inside this box
Comments:.............................................. Date:..............................
L ab Report Status Marks: …………………………………
Signature:....................
.
1. TITLE OF THE LAB EXPERIMENT
1) Given a character, check if it is vowel or not .
2) Factorial of a positive integer is the product of an integer and all the integers
below it,the factorial of number n .
2. OBJECTIVES/AIM [1]
• To provide an introduction to syntax and structure of assembly
language.
• The main objective of this topic is to implement basic conditional
statements in assembly language.
PROCEDURE :
Problem 1
Vowel
Problem 2
As we can see that 5 stacks will have to be maintained until a call to f(0) is
reached whose value is known and is returned. Therefore for n factorial, n
stacks will have to be maintained. Thus space complexity is O(n). It is also
evident from the above pictures that for n=5, 5 stacks will have to
be maintained. Therefore for n factorial, n stacks will have to be
maintained. Thus space complexity is O(n).
3. IMPLEMENTATION
Problem 1
Take a character input from user, check whether the given character is vowel or
not (a,e,i,o,u).:
org 100h
.MODEL SMALL
.STACK 100H
.DATA
msg DB "Enter the Character : $" ;message
msg1 DB 0dh,0ah, "Character is Vowel $" ;message 1
msg2 DB 0dh,0ah, "Character is not Vowel $" ;message
.CODE
MAIN PROC
MOV AX, @DATA
MOV DS, AX
cmp al,'a'
je vowel
cmp al,'e'
je vowel
cmp al,'i'
je vowel
cmp al,'o'
je vowel
cmp al,'u'
je vowel
mov ah,09h
lea dx,msg2
int 21h
jmp exit
vowel:
mov ah,09h
lea dx,msg1
int 21h
exit:
mov ah,4ch
int 21h
main endp
end main
ret
Problem 2
Take a number n from user. After that find out the factorial of that number n.
(Suppose for n=5, you have to find out factorial= 1 * 2 * 3 *4 * 5.
.MODEL SMALL
.STACK 10H
.CODE
MAIN PROC
mov BH,0
mov BL,10D
INPUT:
mov AH,1
int 21H
cmp AL,13D
jne NUMBER
and CX,0
mov CL,BH
dec CX
and AX,0
mov AL,BH
jmp FACT
NUMBER:
sub AL,30H
mov CL,AL
mov AL,BH
mul BL
add AL,CL
mov BH,AL
jmp INPUT
FACT:
mul CX
loop FACT
and DX,0
mov CX,10D
mov BX,0000H
STORE:
mov AH,2
mov DL,0DH
int 21H
mov DL,0AH
int 21H
PRINT:
sub BX,2H
mov DL,[0000H+BX]
add DL,30H
int 21H
cmp BX,0
jne PRINT
MAIN ENDP
END MAIN
.