SlideShare a Scribd company logo
1 of 16
Download to read offline
Lab Report on
Microprocessor and Assembly Language Lab
Course Code: CSE 232
Fall-2014
Submitted To:
Nasrin Akter
Dept. of Computer Science & Engineering
Faculty of Science & Information Technology
Submitted by:
Syed Ahmed Zaki
ID:131-15-2169
Sec: B
Dept. of CSE,FSIT
Date of submission: 12, December 2014
Contents
Problem Page
Problem 1 2
Problem 2 4
Problem 3 7
Problem 4 8
Problem 5 9
Problem 6 10
Problem 7 11
Problem 8 12
1
Problem 1: The sum of 5 and 4 is 9
Solution:
.model small
.stack 100h
.data
m1 db "Enter two number: $"
m2 db "The sum of $"
m3 db " and $"
m4 db " = $"
.code
main proc
mov ax,@data
mov ds,ax
lea dx,m1
mov ah,9
int 21h
mov ah,1
int 21h
mov bl,al
mov ah,1
int 21h
mov bh,al
mov ah,2
mov dl,0dh
int 21h
mov dl,0ah
int 21h
lea dx,m2
mov ah,9
int 21h
2
mov ah,2
mov dl,bl
int 21h
mov ah,9
lea dx,m3
int 21h
mov ah,2
mov dl,bh
int 21h
lea dx,m4
mov ah,9
int 21h
sub bl,30h
sub bh,30h
add bl,bh
add bl,30h
mov ah,2
mov dl,bl
int 21h
mov ah,4ch
int 21h
main endp
end main
Output:
3
Problem 2: Write a program to display the left margin:
Enter seven initial:12345
1
2
3
4
5
Solution:
.model small
.stack 100h
.data
m1 db "Enter five initial:$"
.code
main proc
mov ax,@data
mov ds,ax
lea dx,m1
mov ah,9
int 21h
mov ah,1
int 21h
mov bl,al
mov ah,1
int 21h
mov bh,al
mov ah,1
int 21h
mov cl,al
mov ah,1
int 21h
mov ch,al
4
mov ah,1
int 21h
mov dh,al
mov ah,2
mov dl,0dh
int 21h
mov dl,0ah
int 21h
mov ah,2
mov dl,bl
int 21h
mov ah,2
mov dl,0dh
int 21h
mov dl,0ah
int 21h
mov ah,2
mov dl,bh
int 21h
mov ah,2
mov dl,0dh
int 21h
mov dl,0ah
int 21h
mov ah,2
mov dl,cl
int 21h
mov ah,2
mov dl,0dh
int 21h
mov dl,0ah
int 21h
5
mov ah,2
mov dl,ch
int 21h
mov ah,2
mov dl,0dh
int 21h
mov dl,0ah
int 21h
mov ah,2
mov dl,dh
int 21h
mov ah,4ch
int 21h
main endp
end main
Output:
6
Problem 3: Suppose AL and BL contain two number,Display the one that comes
last in the sequence.
Solution:
.model small
.stack 100h
.code
main proc
mov al,68
mov bl,65
cmp al,bl
jg d1
jmp d2
d1:
mov ah,2
mov dl,al
int 21h
jmp exit
d2:
mov ah,2
mov dl,bl
int 21h
exit:
mov ah,4c
int 21h
main endp
end main
Output:
7
Problem 4: AL and BL contain two characters. Display the last character.
Solution:
.model small
.stack 100h
.code
main proc
mov al,'A'
mov bl,'M'
cmp al,bl
jg d1
jmp d2
d1:
mov ah,2
mov dl,al
int 21h
jmp exit
d2:
mov ah,2
mov dl,bl
int 21h
exit:
mov ah,4ch
int 21h
main endp
end main
Output:
8
Problem 5:If AL contain number display “n” ; If AL contain character
display “c”
Solution:
.model small
.stack 100h
.code
main proc
mov ah,1
int 21h
mov bl,al
mov ah,2
mov dl,0dh
int 21h
mov dl,0ah
int 21h
cmp bl,'1'
je print_number_n
jmp print_character_c
print_number_n:
mov ah,2
mov dl,'n'
int 21h
jmp exit
print_character_c:
mov ah,2
mov dl,'c'
int 21h
exit:
mov ah,4ch
int 21h
9
main endp
end main
Output:
Problem 6: Read a character and if it is lowercase letter, Display it.
Solution:
.model small
.stack 100h
.code
main proc
mov ah,1
int 21h
mov bl,al
cmp bl,'a'
jnge end_if
cmp bl,'z'
jnge end_if
mov ah,2
mov dl,bl
int 21h
end_if:
mov ah,4ch
int 21h
10
main endp
end main
Output:
Problem 7:
Write a count – controlled loop to display a row of 60 stars.
Solution:
.model small
.stack 100h
.code
main proc
mov cx,60
mov ah,2
mov dl,'*'
count:
int 21h
loop count
main endp
end main
11
Output:
Problem 8:
Prompt the user to enter a line of text. On the next line, display the capital
letter entered that comes first alphabetically and the one that comes last. If no
capital entered, display “No capital letters”.
Solution:
.model small
.stack 100h
.data
prompt db 'Type a line of text',0dh,0ah,'$'
nocap_msg db 0dh,0ah,'No capitals $'
cap_msg db 0dh,0ah,'First Capital = '
first db '|'
db ' Last Capital = '
last db '@ $'
.code
main proc
;initialize ds
mov ax,@data
mov ds,ax
;display opening message
12
mov ah,9 ;display string function
lea dx,prompt ;get opening message
int 21h ;display it
;read and process a line of text
mov ah,1 ;read a character function
int 21h ;char in dl
while_:
;while a character is not a carriage return do
cmp al,0dh ;CR?
je end_while ;yes,exit
;if character is a capital letter
cmp al,'A' ;char >='A'?
jnge end_if ;not a capital letter
cmp al,'Z' ;char <= 'Z'?
jnle end_if ;not a capital letter
;then
;if character precedes first capital
cmp al,first ;char < first capital ?
jnl check_last ;no, >=
;then first capital = character
mov first,al ;FIRST=char
;end_if
check_last: ;char >last capital?
;if character follows last capital
cmp al,last ;char > last capital?
jng end_if ;no,<=
;then last capital=character
mov last,al ;last = char
;end_if
13
end_if:
;read a character
int 21h ;char in AL
jmp while_ ;repeat loop
end_while:
;display results
mov ah,9 ;display string function
;if no capitals were typed
cmp first,'|' ;first '|'
jne caps ;no display results
;then
lea dx,nocap_msg ;no capitals
jmp display
caps:
lea dx,cap_msg ;capitals
display:
int 21h ;display message
;end_if
;dos exit
mov ah,4ch
int 21h
main endp
end main
14
Output:
15

More Related Content

What's hot

Presentation on Breadth First Search (BFS)
Presentation on Breadth First Search (BFS)Presentation on Breadth First Search (BFS)
Presentation on Breadth First Search (BFS)Shuvongkor Barman
 
Introduction to ajax
Introduction  to  ajaxIntroduction  to  ajax
Introduction to ajaxPihu Goel
 
Logics for non monotonic reasoning-ai
Logics for non monotonic reasoning-aiLogics for non monotonic reasoning-ai
Logics for non monotonic reasoning-aiShaishavShah8
 
Blockchain in Health Care
Blockchain in Health CareBlockchain in Health Care
Blockchain in Health CarePolsinelli PC
 
Graph in data structure
Graph in data structureGraph in data structure
Graph in data structureAbrish06
 
Lab report for Prolog program in artificial intelligence.
Lab report for Prolog program in artificial intelligence.Lab report for Prolog program in artificial intelligence.
Lab report for Prolog program in artificial intelligence.Alamgir Hossain
 
chapter 7 Logic, shift and rotate instructions
chapter 7 Logic, shift and rotate instructionschapter 7 Logic, shift and rotate instructions
chapter 7 Logic, shift and rotate instructionswarda aziz
 
Digital Logic Design.pptx
Digital Logic Design.pptxDigital Logic Design.pptx
Digital Logic Design.pptxAminaZahid16
 
The n Queen Problem
The n Queen ProblemThe n Queen Problem
The n Queen ProblemSukrit Gupta
 
Production System in AI
Production System in AIProduction System in AI
Production System in AIBharat Bhushan
 
Hadoop HDFS by rohitkapa
Hadoop HDFS by rohitkapaHadoop HDFS by rohitkapa
Hadoop HDFS by rohitkapakapa rohit
 
Elements of dynamic programming
Elements of dynamic programmingElements of dynamic programming
Elements of dynamic programmingTafhim Islam
 
Blockchain in Healthcare
Blockchain in Healthcare Blockchain in Healthcare
Blockchain in Healthcare Alex Tsado
 

What's hot (20)

Presentation on Breadth First Search (BFS)
Presentation on Breadth First Search (BFS)Presentation on Breadth First Search (BFS)
Presentation on Breadth First Search (BFS)
 
Introduction to ajax
Introduction  to  ajaxIntroduction  to  ajax
Introduction to ajax
 
Logics for non monotonic reasoning-ai
Logics for non monotonic reasoning-aiLogics for non monotonic reasoning-ai
Logics for non monotonic reasoning-ai
 
Smart contracts & dApps
Smart contracts & dAppsSmart contracts & dApps
Smart contracts & dApps
 
Unit 4 - Network Layer
Unit 4 - Network LayerUnit 4 - Network Layer
Unit 4 - Network Layer
 
Knapsack problem using fixed tuple
Knapsack problem using fixed tupleKnapsack problem using fixed tuple
Knapsack problem using fixed tuple
 
Ppt of socket
Ppt of socketPpt of socket
Ppt of socket
 
Blockchain in Health Care
Blockchain in Health CareBlockchain in Health Care
Blockchain in Health Care
 
Graph in data structure
Graph in data structureGraph in data structure
Graph in data structure
 
Lab report for Prolog program in artificial intelligence.
Lab report for Prolog program in artificial intelligence.Lab report for Prolog program in artificial intelligence.
Lab report for Prolog program in artificial intelligence.
 
chapter 7 Logic, shift and rotate instructions
chapter 7 Logic, shift and rotate instructionschapter 7 Logic, shift and rotate instructions
chapter 7 Logic, shift and rotate instructions
 
Graph coloring using backtracking
Graph coloring using backtrackingGraph coloring using backtracking
Graph coloring using backtracking
 
Digital Logic Design.pptx
Digital Logic Design.pptxDigital Logic Design.pptx
Digital Logic Design.pptx
 
Ajax and Jquery
Ajax and JqueryAjax and Jquery
Ajax and Jquery
 
The n Queen Problem
The n Queen ProblemThe n Queen Problem
The n Queen Problem
 
Production System in AI
Production System in AIProduction System in AI
Production System in AI
 
Hadoop HDFS by rohitkapa
Hadoop HDFS by rohitkapaHadoop HDFS by rohitkapa
Hadoop HDFS by rohitkapa
 
Elements of dynamic programming
Elements of dynamic programmingElements of dynamic programming
Elements of dynamic programming
 
Knapsack Problem
Knapsack ProblemKnapsack Problem
Knapsack Problem
 
Blockchain in Healthcare
Blockchain in Healthcare Blockchain in Healthcare
Blockchain in Healthcare
 

Similar to Lab report assembly

Taller practico emu8086_galarraga
Taller practico emu8086_galarragaTaller practico emu8086_galarraga
Taller practico emu8086_galarragaFabricio Galárraga
 
Introduction to ibm pc assembly language
Introduction to ibm pc assembly languageIntroduction to ibm pc assembly language
Introduction to ibm pc assembly languagewarda aziz
 
Microprocessor and micro-controller lab (assembly programming)
Microprocessor and micro-controller lab (assembly programming)Microprocessor and micro-controller lab (assembly programming)
Microprocessor and micro-controller lab (assembly programming)shamim hossain
 
Lenguaje ensamblador EMU8086
Lenguaje ensamblador EMU8086Lenguaje ensamblador EMU8086
Lenguaje ensamblador EMU8086Santy Bolo
 
Instalación de emu8086
Instalación de emu8086Instalación de emu8086
Instalación de emu8086Alex Toapanta
 
1 ECE 175 Computer Programming for Engineering Applica.docx
1  ECE 175 Computer Programming for Engineering Applica.docx1  ECE 175 Computer Programming for Engineering Applica.docx
1 ECE 175 Computer Programming for Engineering Applica.docxoswald1horne84988
 
PostgreSQL Open SV 2018
PostgreSQL Open SV 2018PostgreSQL Open SV 2018
PostgreSQL Open SV 2018artgillespie
 
Chapter 6 Flow control Instructions
Chapter 6 Flow control InstructionsChapter 6 Flow control Instructions
Chapter 6 Flow control Instructionswarda aziz
 
Practiceproblems(1)
Practiceproblems(1)Practiceproblems(1)
Practiceproblems(1)Sena Nama
 
T02 a firstcprogram
T02 a firstcprogramT02 a firstcprogram
T02 a firstcprogramprincepavan
 
T02 a firstcprogram
T02 a firstcprogramT02 a firstcprogram
T02 a firstcprogramprincepavan
 
Solved Practice Problems For the C++ Exams
Solved Practice Problems For the C++ ExamsSolved Practice Problems For the C++ Exams
Solved Practice Problems For the C++ ExamsMuhammadTalha436
 
C101-PracticeProblems.pdf
C101-PracticeProblems.pdfC101-PracticeProblems.pdf
C101-PracticeProblems.pdfT17Rockstar
 

Similar to Lab report assembly (20)

Taller practico emu8086_galarraga
Taller practico emu8086_galarragaTaller practico emu8086_galarraga
Taller practico emu8086_galarraga
 
Introduction to ibm pc assembly language
Introduction to ibm pc assembly languageIntroduction to ibm pc assembly language
Introduction to ibm pc assembly language
 
Microprocessor and micro-controller lab (assembly programming)
Microprocessor and micro-controller lab (assembly programming)Microprocessor and micro-controller lab (assembly programming)
Microprocessor and micro-controller lab (assembly programming)
 
Lenguaje ensamblador EMU8086
Lenguaje ensamblador EMU8086Lenguaje ensamblador EMU8086
Lenguaje ensamblador EMU8086
 
Instalación de emu8086
Instalación de emu8086Instalación de emu8086
Instalación de emu8086
 
Assembler
AssemblerAssembler
Assembler
 
07_strtok.pdf
07_strtok.pdf07_strtok.pdf
07_strtok.pdf
 
Emulador emu8086
Emulador emu8086Emulador emu8086
Emulador emu8086
 
1 ECE 175 Computer Programming for Engineering Applica.docx
1  ECE 175 Computer Programming for Engineering Applica.docx1  ECE 175 Computer Programming for Engineering Applica.docx
1 ECE 175 Computer Programming for Engineering Applica.docx
 
PostgreSQL Open SV 2018
PostgreSQL Open SV 2018PostgreSQL Open SV 2018
PostgreSQL Open SV 2018
 
Compiladores emu8086
Compiladores emu8086Compiladores emu8086
Compiladores emu8086
 
5 a4.output
5 a4.output5 a4.output
5 a4.output
 
Taller Ensambladores
Taller EnsambladoresTaller Ensambladores
Taller Ensambladores
 
Chapter 6 Flow control Instructions
Chapter 6 Flow control InstructionsChapter 6 Flow control Instructions
Chapter 6 Flow control Instructions
 
C++ TUTORIAL 3
C++ TUTORIAL 3C++ TUTORIAL 3
C++ TUTORIAL 3
 
Practiceproblems(1)
Practiceproblems(1)Practiceproblems(1)
Practiceproblems(1)
 
T02 a firstcprogram
T02 a firstcprogramT02 a firstcprogram
T02 a firstcprogram
 
T02 a firstcprogram
T02 a firstcprogramT02 a firstcprogram
T02 a firstcprogram
 
Solved Practice Problems For the C++ Exams
Solved Practice Problems For the C++ ExamsSolved Practice Problems For the C++ Exams
Solved Practice Problems For the C++ Exams
 
C101-PracticeProblems.pdf
C101-PracticeProblems.pdfC101-PracticeProblems.pdf
C101-PracticeProblems.pdf
 

More from Syed Ahmed Zaki

Assignment on Numerical Method C Code
Assignment on Numerical Method C CodeAssignment on Numerical Method C Code
Assignment on Numerical Method C CodeSyed Ahmed Zaki
 
Presentation on Numerical Method (Trapezoidal Method)
Presentation on Numerical Method (Trapezoidal Method)Presentation on Numerical Method (Trapezoidal Method)
Presentation on Numerical Method (Trapezoidal Method)Syed Ahmed Zaki
 
Presentation on Transmission Media
Presentation on Transmission MediaPresentation on Transmission Media
Presentation on Transmission MediaSyed Ahmed Zaki
 
Architecture of 80286 microprocessor
Architecture of 80286 microprocessorArchitecture of 80286 microprocessor
Architecture of 80286 microprocessorSyed Ahmed Zaki
 
Importance of Electric Device Knowledge in Computer Science Education
Importance of Electric Device Knowledge in Computer Science EducationImportance of Electric Device Knowledge in Computer Science Education
Importance of Electric Device Knowledge in Computer Science EducationSyed Ahmed Zaki
 
Presentation on bernoulli
Presentation on bernoulliPresentation on bernoulli
Presentation on bernoulliSyed Ahmed Zaki
 
Presentation on inverse matrix
Presentation on inverse matrixPresentation on inverse matrix
Presentation on inverse matrixSyed Ahmed Zaki
 
Project Report - Diabetic Profile Management System : Structured Programming ...
Project Report - Diabetic Profile Management System : Structured Programming ...Project Report - Diabetic Profile Management System : Structured Programming ...
Project Report - Diabetic Profile Management System : Structured Programming ...Syed Ahmed Zaki
 
History and Real Life Applications of Fourier Analaysis
History and Real Life Applications of Fourier AnalaysisHistory and Real Life Applications of Fourier Analaysis
History and Real Life Applications of Fourier AnalaysisSyed Ahmed Zaki
 

More from Syed Ahmed Zaki (11)

Networking Lab Report
Networking Lab ReportNetworking Lab Report
Networking Lab Report
 
Assignment on Numerical Method C Code
Assignment on Numerical Method C CodeAssignment on Numerical Method C Code
Assignment on Numerical Method C Code
 
Presentation on Numerical Method (Trapezoidal Method)
Presentation on Numerical Method (Trapezoidal Method)Presentation on Numerical Method (Trapezoidal Method)
Presentation on Numerical Method (Trapezoidal Method)
 
Presentation on Transmission Media
Presentation on Transmission MediaPresentation on Transmission Media
Presentation on Transmission Media
 
Architecture of 80286 microprocessor
Architecture of 80286 microprocessorArchitecture of 80286 microprocessor
Architecture of 80286 microprocessor
 
Algorithm Presentation
Algorithm PresentationAlgorithm Presentation
Algorithm Presentation
 
Importance of Electric Device Knowledge in Computer Science Education
Importance of Electric Device Knowledge in Computer Science EducationImportance of Electric Device Knowledge in Computer Science Education
Importance of Electric Device Knowledge in Computer Science Education
 
Presentation on bernoulli
Presentation on bernoulliPresentation on bernoulli
Presentation on bernoulli
 
Presentation on inverse matrix
Presentation on inverse matrixPresentation on inverse matrix
Presentation on inverse matrix
 
Project Report - Diabetic Profile Management System : Structured Programming ...
Project Report - Diabetic Profile Management System : Structured Programming ...Project Report - Diabetic Profile Management System : Structured Programming ...
Project Report - Diabetic Profile Management System : Structured Programming ...
 
History and Real Life Applications of Fourier Analaysis
History and Real Life Applications of Fourier AnalaysisHistory and Real Life Applications of Fourier Analaysis
History and Real Life Applications of Fourier Analaysis
 

Recently uploaded

OSVC_Meta-Data based Simulation Automation to overcome Verification Challenge...
OSVC_Meta-Data based Simulation Automation to overcome Verification Challenge...OSVC_Meta-Data based Simulation Automation to overcome Verification Challenge...
OSVC_Meta-Data based Simulation Automation to overcome Verification Challenge...Soham Mondal
 
Sheet Pile Wall Design and Construction: A Practical Guide for Civil Engineer...
Sheet Pile Wall Design and Construction: A Practical Guide for Civil Engineer...Sheet Pile Wall Design and Construction: A Practical Guide for Civil Engineer...
Sheet Pile Wall Design and Construction: A Practical Guide for Civil Engineer...Dr.Costas Sachpazis
 
What are the advantages and disadvantages of membrane structures.pptx
What are the advantages and disadvantages of membrane structures.pptxWhat are the advantages and disadvantages of membrane structures.pptx
What are the advantages and disadvantages of membrane structures.pptxwendy cai
 
IMPLICATIONS OF THE ABOVE HOLISTIC UNDERSTANDING OF HARMONY ON PROFESSIONAL E...
IMPLICATIONS OF THE ABOVE HOLISTIC UNDERSTANDING OF HARMONY ON PROFESSIONAL E...IMPLICATIONS OF THE ABOVE HOLISTIC UNDERSTANDING OF HARMONY ON PROFESSIONAL E...
IMPLICATIONS OF THE ABOVE HOLISTIC UNDERSTANDING OF HARMONY ON PROFESSIONAL E...RajaP95
 
Introduction to Multiple Access Protocol.pptx
Introduction to Multiple Access Protocol.pptxIntroduction to Multiple Access Protocol.pptx
Introduction to Multiple Access Protocol.pptxupamatechverse
 
Call Girls Delhi {Jodhpur} 9711199012 high profile service
Call Girls Delhi {Jodhpur} 9711199012 high profile serviceCall Girls Delhi {Jodhpur} 9711199012 high profile service
Call Girls Delhi {Jodhpur} 9711199012 high profile servicerehmti665
 
HARDNESS, FRACTURE TOUGHNESS AND STRENGTH OF CERAMICS
HARDNESS, FRACTURE TOUGHNESS AND STRENGTH OF CERAMICSHARDNESS, FRACTURE TOUGHNESS AND STRENGTH OF CERAMICS
HARDNESS, FRACTURE TOUGHNESS AND STRENGTH OF CERAMICSRajkumarAkumalla
 
VIP Call Girls Service Kondapur Hyderabad Call +91-8250192130
VIP Call Girls Service Kondapur Hyderabad Call +91-8250192130VIP Call Girls Service Kondapur Hyderabad Call +91-8250192130
VIP Call Girls Service Kondapur Hyderabad Call +91-8250192130Suhani Kapoor
 
Software Development Life Cycle By Team Orange (Dept. of Pharmacy)
Software Development Life Cycle By  Team Orange (Dept. of Pharmacy)Software Development Life Cycle By  Team Orange (Dept. of Pharmacy)
Software Development Life Cycle By Team Orange (Dept. of Pharmacy)Suman Mia
 
(RIA) Call Girls Bhosari ( 7001035870 ) HI-Fi Pune Escorts Service
(RIA) Call Girls Bhosari ( 7001035870 ) HI-Fi Pune Escorts Service(RIA) Call Girls Bhosari ( 7001035870 ) HI-Fi Pune Escorts Service
(RIA) Call Girls Bhosari ( 7001035870 ) HI-Fi Pune Escorts Serviceranjana rawat
 
High Profile Call Girls Nagpur Meera Call 7001035870 Meet With Nagpur Escorts
High Profile Call Girls Nagpur Meera Call 7001035870 Meet With Nagpur EscortsHigh Profile Call Girls Nagpur Meera Call 7001035870 Meet With Nagpur Escorts
High Profile Call Girls Nagpur Meera Call 7001035870 Meet With Nagpur EscortsCall Girls in Nagpur High Profile
 
Call Girls Service Nagpur Tanvi Call 7001035870 Meet With Nagpur Escorts
Call Girls Service Nagpur Tanvi Call 7001035870 Meet With Nagpur EscortsCall Girls Service Nagpur Tanvi Call 7001035870 Meet With Nagpur Escorts
Call Girls Service Nagpur Tanvi Call 7001035870 Meet With Nagpur EscortsCall Girls in Nagpur High Profile
 
Microscopic Analysis of Ceramic Materials.pptx
Microscopic Analysis of Ceramic Materials.pptxMicroscopic Analysis of Ceramic Materials.pptx
Microscopic Analysis of Ceramic Materials.pptxpurnimasatapathy1234
 
Internship report on mechanical engineering
Internship report on mechanical engineeringInternship report on mechanical engineering
Internship report on mechanical engineeringmalavadedarshan25
 
Call Girls in Nagpur Suman Call 7001035870 Meet With Nagpur Escorts
Call Girls in Nagpur Suman Call 7001035870 Meet With Nagpur EscortsCall Girls in Nagpur Suman Call 7001035870 Meet With Nagpur Escorts
Call Girls in Nagpur Suman Call 7001035870 Meet With Nagpur EscortsCall Girls in Nagpur High Profile
 
Analog to Digital and Digital to Analog Converter
Analog to Digital and Digital to Analog ConverterAnalog to Digital and Digital to Analog Converter
Analog to Digital and Digital to Analog ConverterAbhinavSharma374939
 
Study on Air-Water & Water-Water Heat Exchange in a Finned Tube Exchanger
Study on Air-Water & Water-Water Heat Exchange in a Finned Tube ExchangerStudy on Air-Water & Water-Water Heat Exchange in a Finned Tube Exchanger
Study on Air-Water & Water-Water Heat Exchange in a Finned Tube ExchangerAnamika Sarkar
 
Current Transformer Drawing and GTP for MSETCL
Current Transformer Drawing and GTP for MSETCLCurrent Transformer Drawing and GTP for MSETCL
Current Transformer Drawing and GTP for MSETCLDeelipZope
 

Recently uploaded (20)

OSVC_Meta-Data based Simulation Automation to overcome Verification Challenge...
OSVC_Meta-Data based Simulation Automation to overcome Verification Challenge...OSVC_Meta-Data based Simulation Automation to overcome Verification Challenge...
OSVC_Meta-Data based Simulation Automation to overcome Verification Challenge...
 
Sheet Pile Wall Design and Construction: A Practical Guide for Civil Engineer...
Sheet Pile Wall Design and Construction: A Practical Guide for Civil Engineer...Sheet Pile Wall Design and Construction: A Practical Guide for Civil Engineer...
Sheet Pile Wall Design and Construction: A Practical Guide for Civil Engineer...
 
What are the advantages and disadvantages of membrane structures.pptx
What are the advantages and disadvantages of membrane structures.pptxWhat are the advantages and disadvantages of membrane structures.pptx
What are the advantages and disadvantages of membrane structures.pptx
 
IMPLICATIONS OF THE ABOVE HOLISTIC UNDERSTANDING OF HARMONY ON PROFESSIONAL E...
IMPLICATIONS OF THE ABOVE HOLISTIC UNDERSTANDING OF HARMONY ON PROFESSIONAL E...IMPLICATIONS OF THE ABOVE HOLISTIC UNDERSTANDING OF HARMONY ON PROFESSIONAL E...
IMPLICATIONS OF THE ABOVE HOLISTIC UNDERSTANDING OF HARMONY ON PROFESSIONAL E...
 
Introduction to Multiple Access Protocol.pptx
Introduction to Multiple Access Protocol.pptxIntroduction to Multiple Access Protocol.pptx
Introduction to Multiple Access Protocol.pptx
 
Call Girls Delhi {Jodhpur} 9711199012 high profile service
Call Girls Delhi {Jodhpur} 9711199012 high profile serviceCall Girls Delhi {Jodhpur} 9711199012 high profile service
Call Girls Delhi {Jodhpur} 9711199012 high profile service
 
HARDNESS, FRACTURE TOUGHNESS AND STRENGTH OF CERAMICS
HARDNESS, FRACTURE TOUGHNESS AND STRENGTH OF CERAMICSHARDNESS, FRACTURE TOUGHNESS AND STRENGTH OF CERAMICS
HARDNESS, FRACTURE TOUGHNESS AND STRENGTH OF CERAMICS
 
VIP Call Girls Service Kondapur Hyderabad Call +91-8250192130
VIP Call Girls Service Kondapur Hyderabad Call +91-8250192130VIP Call Girls Service Kondapur Hyderabad Call +91-8250192130
VIP Call Girls Service Kondapur Hyderabad Call +91-8250192130
 
Software Development Life Cycle By Team Orange (Dept. of Pharmacy)
Software Development Life Cycle By  Team Orange (Dept. of Pharmacy)Software Development Life Cycle By  Team Orange (Dept. of Pharmacy)
Software Development Life Cycle By Team Orange (Dept. of Pharmacy)
 
(RIA) Call Girls Bhosari ( 7001035870 ) HI-Fi Pune Escorts Service
(RIA) Call Girls Bhosari ( 7001035870 ) HI-Fi Pune Escorts Service(RIA) Call Girls Bhosari ( 7001035870 ) HI-Fi Pune Escorts Service
(RIA) Call Girls Bhosari ( 7001035870 ) HI-Fi Pune Escorts Service
 
DJARUM4D - SLOT GACOR ONLINE | SLOT DEMO ONLINE
DJARUM4D - SLOT GACOR ONLINE | SLOT DEMO ONLINEDJARUM4D - SLOT GACOR ONLINE | SLOT DEMO ONLINE
DJARUM4D - SLOT GACOR ONLINE | SLOT DEMO ONLINE
 
High Profile Call Girls Nagpur Meera Call 7001035870 Meet With Nagpur Escorts
High Profile Call Girls Nagpur Meera Call 7001035870 Meet With Nagpur EscortsHigh Profile Call Girls Nagpur Meera Call 7001035870 Meet With Nagpur Escorts
High Profile Call Girls Nagpur Meera Call 7001035870 Meet With Nagpur Escorts
 
Call Girls Service Nagpur Tanvi Call 7001035870 Meet With Nagpur Escorts
Call Girls Service Nagpur Tanvi Call 7001035870 Meet With Nagpur EscortsCall Girls Service Nagpur Tanvi Call 7001035870 Meet With Nagpur Escorts
Call Girls Service Nagpur Tanvi Call 7001035870 Meet With Nagpur Escorts
 
Microscopic Analysis of Ceramic Materials.pptx
Microscopic Analysis of Ceramic Materials.pptxMicroscopic Analysis of Ceramic Materials.pptx
Microscopic Analysis of Ceramic Materials.pptx
 
Internship report on mechanical engineering
Internship report on mechanical engineeringInternship report on mechanical engineering
Internship report on mechanical engineering
 
Call Girls in Nagpur Suman Call 7001035870 Meet With Nagpur Escorts
Call Girls in Nagpur Suman Call 7001035870 Meet With Nagpur EscortsCall Girls in Nagpur Suman Call 7001035870 Meet With Nagpur Escorts
Call Girls in Nagpur Suman Call 7001035870 Meet With Nagpur Escorts
 
Analog to Digital and Digital to Analog Converter
Analog to Digital and Digital to Analog ConverterAnalog to Digital and Digital to Analog Converter
Analog to Digital and Digital to Analog Converter
 
Study on Air-Water & Water-Water Heat Exchange in a Finned Tube Exchanger
Study on Air-Water & Water-Water Heat Exchange in a Finned Tube ExchangerStudy on Air-Water & Water-Water Heat Exchange in a Finned Tube Exchanger
Study on Air-Water & Water-Water Heat Exchange in a Finned Tube Exchanger
 
Exploring_Network_Security_with_JA3_by_Rakesh Seal.pptx
Exploring_Network_Security_with_JA3_by_Rakesh Seal.pptxExploring_Network_Security_with_JA3_by_Rakesh Seal.pptx
Exploring_Network_Security_with_JA3_by_Rakesh Seal.pptx
 
Current Transformer Drawing and GTP for MSETCL
Current Transformer Drawing and GTP for MSETCLCurrent Transformer Drawing and GTP for MSETCL
Current Transformer Drawing and GTP for MSETCL
 

Lab report assembly

  • 1. Lab Report on Microprocessor and Assembly Language Lab Course Code: CSE 232 Fall-2014 Submitted To: Nasrin Akter Dept. of Computer Science & Engineering Faculty of Science & Information Technology Submitted by: Syed Ahmed Zaki ID:131-15-2169 Sec: B Dept. of CSE,FSIT Date of submission: 12, December 2014
  • 2. Contents Problem Page Problem 1 2 Problem 2 4 Problem 3 7 Problem 4 8 Problem 5 9 Problem 6 10 Problem 7 11 Problem 8 12 1
  • 3. Problem 1: The sum of 5 and 4 is 9 Solution: .model small .stack 100h .data m1 db "Enter two number: $" m2 db "The sum of $" m3 db " and $" m4 db " = $" .code main proc mov ax,@data mov ds,ax lea dx,m1 mov ah,9 int 21h mov ah,1 int 21h mov bl,al mov ah,1 int 21h mov bh,al mov ah,2 mov dl,0dh int 21h mov dl,0ah int 21h lea dx,m2 mov ah,9 int 21h 2
  • 4. mov ah,2 mov dl,bl int 21h mov ah,9 lea dx,m3 int 21h mov ah,2 mov dl,bh int 21h lea dx,m4 mov ah,9 int 21h sub bl,30h sub bh,30h add bl,bh add bl,30h mov ah,2 mov dl,bl int 21h mov ah,4ch int 21h main endp end main Output: 3
  • 5. Problem 2: Write a program to display the left margin: Enter seven initial:12345 1 2 3 4 5 Solution: .model small .stack 100h .data m1 db "Enter five initial:$" .code main proc mov ax,@data mov ds,ax lea dx,m1 mov ah,9 int 21h mov ah,1 int 21h mov bl,al mov ah,1 int 21h mov bh,al mov ah,1 int 21h mov cl,al mov ah,1 int 21h mov ch,al 4
  • 6. mov ah,1 int 21h mov dh,al mov ah,2 mov dl,0dh int 21h mov dl,0ah int 21h mov ah,2 mov dl,bl int 21h mov ah,2 mov dl,0dh int 21h mov dl,0ah int 21h mov ah,2 mov dl,bh int 21h mov ah,2 mov dl,0dh int 21h mov dl,0ah int 21h mov ah,2 mov dl,cl int 21h mov ah,2 mov dl,0dh int 21h mov dl,0ah int 21h 5
  • 7. mov ah,2 mov dl,ch int 21h mov ah,2 mov dl,0dh int 21h mov dl,0ah int 21h mov ah,2 mov dl,dh int 21h mov ah,4ch int 21h main endp end main Output: 6
  • 8. Problem 3: Suppose AL and BL contain two number,Display the one that comes last in the sequence. Solution: .model small .stack 100h .code main proc mov al,68 mov bl,65 cmp al,bl jg d1 jmp d2 d1: mov ah,2 mov dl,al int 21h jmp exit d2: mov ah,2 mov dl,bl int 21h exit: mov ah,4c int 21h main endp end main Output: 7
  • 9. Problem 4: AL and BL contain two characters. Display the last character. Solution: .model small .stack 100h .code main proc mov al,'A' mov bl,'M' cmp al,bl jg d1 jmp d2 d1: mov ah,2 mov dl,al int 21h jmp exit d2: mov ah,2 mov dl,bl int 21h exit: mov ah,4ch int 21h main endp end main Output: 8
  • 10. Problem 5:If AL contain number display “n” ; If AL contain character display “c” Solution: .model small .stack 100h .code main proc mov ah,1 int 21h mov bl,al mov ah,2 mov dl,0dh int 21h mov dl,0ah int 21h cmp bl,'1' je print_number_n jmp print_character_c print_number_n: mov ah,2 mov dl,'n' int 21h jmp exit print_character_c: mov ah,2 mov dl,'c' int 21h exit: mov ah,4ch int 21h 9
  • 11. main endp end main Output: Problem 6: Read a character and if it is lowercase letter, Display it. Solution: .model small .stack 100h .code main proc mov ah,1 int 21h mov bl,al cmp bl,'a' jnge end_if cmp bl,'z' jnge end_if mov ah,2 mov dl,bl int 21h end_if: mov ah,4ch int 21h 10
  • 12. main endp end main Output: Problem 7: Write a count – controlled loop to display a row of 60 stars. Solution: .model small .stack 100h .code main proc mov cx,60 mov ah,2 mov dl,'*' count: int 21h loop count main endp end main 11
  • 13. Output: Problem 8: Prompt the user to enter a line of text. On the next line, display the capital letter entered that comes first alphabetically and the one that comes last. If no capital entered, display “No capital letters”. Solution: .model small .stack 100h .data prompt db 'Type a line of text',0dh,0ah,'$' nocap_msg db 0dh,0ah,'No capitals $' cap_msg db 0dh,0ah,'First Capital = ' first db '|' db ' Last Capital = ' last db '@ $' .code main proc ;initialize ds mov ax,@data mov ds,ax ;display opening message 12
  • 14. mov ah,9 ;display string function lea dx,prompt ;get opening message int 21h ;display it ;read and process a line of text mov ah,1 ;read a character function int 21h ;char in dl while_: ;while a character is not a carriage return do cmp al,0dh ;CR? je end_while ;yes,exit ;if character is a capital letter cmp al,'A' ;char >='A'? jnge end_if ;not a capital letter cmp al,'Z' ;char <= 'Z'? jnle end_if ;not a capital letter ;then ;if character precedes first capital cmp al,first ;char < first capital ? jnl check_last ;no, >= ;then first capital = character mov first,al ;FIRST=char ;end_if check_last: ;char >last capital? ;if character follows last capital cmp al,last ;char > last capital? jng end_if ;no,<= ;then last capital=character mov last,al ;last = char ;end_if 13
  • 15. end_if: ;read a character int 21h ;char in AL jmp while_ ;repeat loop end_while: ;display results mov ah,9 ;display string function ;if no capitals were typed cmp first,'|' ;first '|' jne caps ;no display results ;then lea dx,nocap_msg ;no capitals jmp display caps: lea dx,cap_msg ;capitals display: int 21h ;display message ;end_if ;dos exit mov ah,4ch int 21h main endp end main 14