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

Mathematical Analysis of Non-Recursive Algorithm.
Mathematical Analysis of Non-Recursive Algorithm.Mathematical Analysis of Non-Recursive Algorithm.
Mathematical Analysis of Non-Recursive Algorithm.mohanrathod18
 
Artificial neural networks (2)
Artificial neural networks (2)Artificial neural networks (2)
Artificial neural networks (2)sai anjaneya
 
Uninformed search /Blind search in AI
Uninformed search /Blind search in AIUninformed search /Blind search in AI
Uninformed search /Blind search in AIKirti Verma
 
Prediction of heart disease using machine learning.pptx
Prediction of heart disease using machine learning.pptxPrediction of heart disease using machine learning.pptx
Prediction of heart disease using machine learning.pptxkumari36
 
CNN Attention Networks
CNN Attention NetworksCNN Attention Networks
CNN Attention NetworksTaeoh Kim
 
Job sequencing with deadline
Job sequencing with deadlineJob sequencing with deadline
Job sequencing with deadlineArafat Hossan
 
Machine Learning in Healthcare Diagnostics
Machine Learning in Healthcare DiagnosticsMachine Learning in Healthcare Diagnostics
Machine Learning in Healthcare DiagnosticsLarry Smarr
 
Assignment problem branch and bound.pptx
Assignment problem branch and bound.pptxAssignment problem branch and bound.pptx
Assignment problem branch and bound.pptxKrishnaVardhan50
 
UNIT III NON LINEAR DATA STRUCTURES – TREES
UNIT III 	NON LINEAR DATA STRUCTURES – TREESUNIT III 	NON LINEAR DATA STRUCTURES – TREES
UNIT III NON LINEAR DATA STRUCTURES – TREESKathirvel Ayyaswamy
 
Divide and Conquer - Part II - Quickselect and Closest Pair of Points
Divide and Conquer - Part II - Quickselect and Closest Pair of PointsDivide and Conquer - Part II - Quickselect and Closest Pair of Points
Divide and Conquer - Part II - Quickselect and Closest Pair of PointsAmrinder Arora
 
Perceptron (neural network)
Perceptron (neural network)Perceptron (neural network)
Perceptron (neural network)EdutechLearners
 

What's hot (20)

Mathematical Analysis of Non-Recursive Algorithm.
Mathematical Analysis of Non-Recursive Algorithm.Mathematical Analysis of Non-Recursive Algorithm.
Mathematical Analysis of Non-Recursive Algorithm.
 
Branch and bound
Branch and boundBranch and bound
Branch and bound
 
Introduction to soft computing
 Introduction to soft computing Introduction to soft computing
Introduction to soft computing
 
Mc culloch pitts neuron
Mc culloch pitts neuronMc culloch pitts neuron
Mc culloch pitts neuron
 
Artificial neural networks (2)
Artificial neural networks (2)Artificial neural networks (2)
Artificial neural networks (2)
 
N Queens problem
N Queens problemN Queens problem
N Queens problem
 
Uninformed search /Blind search in AI
Uninformed search /Blind search in AIUninformed search /Blind search in AI
Uninformed search /Blind search in AI
 
Prediction of heart disease using machine learning.pptx
Prediction of heart disease using machine learning.pptxPrediction of heart disease using machine learning.pptx
Prediction of heart disease using machine learning.pptx
 
CNN Attention Networks
CNN Attention NetworksCNN Attention Networks
CNN Attention Networks
 
Job sequencing with deadline
Job sequencing with deadlineJob sequencing with deadline
Job sequencing with deadline
 
Defuzzification
DefuzzificationDefuzzification
Defuzzification
 
Machine Learning in Healthcare Diagnostics
Machine Learning in Healthcare DiagnosticsMachine Learning in Healthcare Diagnostics
Machine Learning in Healthcare Diagnostics
 
Assignment problem branch and bound.pptx
Assignment problem branch and bound.pptxAssignment problem branch and bound.pptx
Assignment problem branch and bound.pptx
 
UNIT III NON LINEAR DATA STRUCTURES – TREES
UNIT III 	NON LINEAR DATA STRUCTURES – TREESUNIT III 	NON LINEAR DATA STRUCTURES – TREES
UNIT III NON LINEAR DATA STRUCTURES – TREES
 
Backtracking
BacktrackingBacktracking
Backtracking
 
Daa notes 1
Daa notes 1Daa notes 1
Daa notes 1
 
Divide and Conquer - Part II - Quickselect and Closest Pair of Points
Divide and Conquer - Part II - Quickselect and Closest Pair of PointsDivide and Conquer - Part II - Quickselect and Closest Pair of Points
Divide and Conquer - Part II - Quickselect and Closest Pair of Points
 
Artificial Intelligence
Artificial IntelligenceArtificial Intelligence
Artificial Intelligence
 
Algorithms, Union Find
Algorithms, Union FindAlgorithms, Union Find
Algorithms, Union Find
 
Perceptron (neural network)
Perceptron (neural network)Perceptron (neural network)
Perceptron (neural network)
 

Similar to Lab report assembly

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
 
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
 

Similar to Lab report assembly (20)

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
 
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
 

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

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
 
Top Rated Pune Call Girls Budhwar Peth ⟟ 6297143586 ⟟ Call Me For Genuine Se...
Top Rated  Pune Call Girls Budhwar Peth ⟟ 6297143586 ⟟ Call Me For Genuine Se...Top Rated  Pune Call Girls Budhwar Peth ⟟ 6297143586 ⟟ Call Me For Genuine Se...
Top Rated Pune Call Girls Budhwar Peth ⟟ 6297143586 ⟟ Call Me For Genuine Se...Call 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
 
High Profile Call Girls Nagpur Isha Call 7001035870 Meet With Nagpur Escorts
High Profile Call Girls Nagpur Isha Call 7001035870 Meet With Nagpur EscortsHigh Profile Call Girls Nagpur Isha Call 7001035870 Meet With Nagpur Escorts
High Profile Call Girls Nagpur Isha Call 7001035870 Meet With Nagpur Escortsranjana rawat
 
(MEERA) Dapodi Call Girls Just Call 7001035870 [ Cash on Delivery ] Pune Escorts
(MEERA) Dapodi Call Girls Just Call 7001035870 [ Cash on Delivery ] Pune Escorts(MEERA) Dapodi Call Girls Just Call 7001035870 [ Cash on Delivery ] Pune Escorts
(MEERA) Dapodi Call Girls Just Call 7001035870 [ Cash on Delivery ] Pune Escortsranjana rawat
 
Processing & Properties of Floor and Wall Tiles.pptx
Processing & Properties of Floor and Wall Tiles.pptxProcessing & Properties of Floor and Wall Tiles.pptx
Processing & Properties of Floor and Wall Tiles.pptxpranjaldaimarysona
 
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
 
247267395-1-Symmetric-and-distributed-shared-memory-architectures-ppt (1).ppt
247267395-1-Symmetric-and-distributed-shared-memory-architectures-ppt (1).ppt247267395-1-Symmetric-and-distributed-shared-memory-architectures-ppt (1).ppt
247267395-1-Symmetric-and-distributed-shared-memory-architectures-ppt (1).pptssuser5c9d4b1
 
Extrusion Processes and Their Limitations
Extrusion Processes and Their LimitationsExtrusion Processes and Their Limitations
Extrusion Processes and Their Limitations120cr0395
 
Introduction to Multiple Access Protocol.pptx
Introduction to Multiple Access Protocol.pptxIntroduction to Multiple Access Protocol.pptx
Introduction to Multiple Access Protocol.pptxupamatechverse
 
(PRIYA) Rajgurunagar Call Girls Just Call 7001035870 [ Cash on Delivery ] Pun...
(PRIYA) Rajgurunagar Call Girls Just Call 7001035870 [ Cash on Delivery ] Pun...(PRIYA) Rajgurunagar Call Girls Just Call 7001035870 [ Cash on Delivery ] Pun...
(PRIYA) Rajgurunagar Call Girls Just Call 7001035870 [ Cash on Delivery ] Pun...ranjana rawat
 
UNIT-III FMM. DIMENSIONAL ANALYSIS
UNIT-III FMM.        DIMENSIONAL ANALYSISUNIT-III FMM.        DIMENSIONAL ANALYSIS
UNIT-III FMM. DIMENSIONAL ANALYSISrknatarajan
 
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
 
Introduction to IEEE STANDARDS and its different types.pptx
Introduction to IEEE STANDARDS and its different types.pptxIntroduction to IEEE STANDARDS and its different types.pptx
Introduction to IEEE STANDARDS and its different types.pptxupamatechverse
 
UNIT-V FMM.HYDRAULIC TURBINE - Construction and working
UNIT-V FMM.HYDRAULIC TURBINE - Construction and workingUNIT-V FMM.HYDRAULIC TURBINE - Construction and working
UNIT-V FMM.HYDRAULIC TURBINE - Construction and workingrknatarajan
 
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
 
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
 
HARMONY IN THE NATURE AND EXISTENCE - Unit-IV
HARMONY IN THE NATURE AND EXISTENCE - Unit-IVHARMONY IN THE NATURE AND EXISTENCE - Unit-IV
HARMONY IN THE NATURE AND EXISTENCE - Unit-IVRajaP95
 

Recently uploaded (20)

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
 
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
 
Top Rated Pune Call Girls Budhwar Peth ⟟ 6297143586 ⟟ Call Me For Genuine Se...
Top Rated  Pune Call Girls Budhwar Peth ⟟ 6297143586 ⟟ Call Me For Genuine Se...Top Rated  Pune Call Girls Budhwar Peth ⟟ 6297143586 ⟟ Call Me For Genuine Se...
Top Rated Pune Call Girls Budhwar Peth ⟟ 6297143586 ⟟ Call Me For Genuine Se...
 
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
 
High Profile Call Girls Nagpur Isha Call 7001035870 Meet With Nagpur Escorts
High Profile Call Girls Nagpur Isha Call 7001035870 Meet With Nagpur EscortsHigh Profile Call Girls Nagpur Isha Call 7001035870 Meet With Nagpur Escorts
High Profile Call Girls Nagpur Isha Call 7001035870 Meet With Nagpur Escorts
 
(MEERA) Dapodi Call Girls Just Call 7001035870 [ Cash on Delivery ] Pune Escorts
(MEERA) Dapodi Call Girls Just Call 7001035870 [ Cash on Delivery ] Pune Escorts(MEERA) Dapodi Call Girls Just Call 7001035870 [ Cash on Delivery ] Pune Escorts
(MEERA) Dapodi Call Girls Just Call 7001035870 [ Cash on Delivery ] Pune Escorts
 
Processing & Properties of Floor and Wall Tiles.pptx
Processing & Properties of Floor and Wall Tiles.pptxProcessing & Properties of Floor and Wall Tiles.pptx
Processing & Properties of Floor and Wall Tiles.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...
 
247267395-1-Symmetric-and-distributed-shared-memory-architectures-ppt (1).ppt
247267395-1-Symmetric-and-distributed-shared-memory-architectures-ppt (1).ppt247267395-1-Symmetric-and-distributed-shared-memory-architectures-ppt (1).ppt
247267395-1-Symmetric-and-distributed-shared-memory-architectures-ppt (1).ppt
 
Extrusion Processes and Their Limitations
Extrusion Processes and Their LimitationsExtrusion Processes and Their Limitations
Extrusion Processes and Their Limitations
 
Introduction to Multiple Access Protocol.pptx
Introduction to Multiple Access Protocol.pptxIntroduction to Multiple Access Protocol.pptx
Introduction to Multiple Access Protocol.pptx
 
(PRIYA) Rajgurunagar Call Girls Just Call 7001035870 [ Cash on Delivery ] Pun...
(PRIYA) Rajgurunagar Call Girls Just Call 7001035870 [ Cash on Delivery ] Pun...(PRIYA) Rajgurunagar Call Girls Just Call 7001035870 [ Cash on Delivery ] Pun...
(PRIYA) Rajgurunagar Call Girls Just Call 7001035870 [ Cash on Delivery ] Pun...
 
UNIT-III FMM. DIMENSIONAL ANALYSIS
UNIT-III FMM.        DIMENSIONAL ANALYSISUNIT-III FMM.        DIMENSIONAL ANALYSIS
UNIT-III FMM. DIMENSIONAL ANALYSIS
 
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
 
Introduction to IEEE STANDARDS and its different types.pptx
Introduction to IEEE STANDARDS and its different types.pptxIntroduction to IEEE STANDARDS and its different types.pptx
Introduction to IEEE STANDARDS and its different types.pptx
 
UNIT-V FMM.HYDRAULIC TURBINE - Construction and working
UNIT-V FMM.HYDRAULIC TURBINE - Construction and workingUNIT-V FMM.HYDRAULIC TURBINE - Construction and working
UNIT-V FMM.HYDRAULIC TURBINE - Construction and working
 
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)
 
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
 
HARMONY IN THE NATURE AND EXISTENCE - Unit-IV
HARMONY IN THE NATURE AND EXISTENCE - Unit-IVHARMONY IN THE NATURE AND EXISTENCE - Unit-IV
HARMONY IN THE NATURE AND EXISTENCE - Unit-IV
 
Call Us -/9953056974- Call Girls In Vikaspuri-/- Delhi NCR
Call Us -/9953056974- Call Girls In Vikaspuri-/- Delhi NCRCall Us -/9953056974- Call Girls In Vikaspuri-/- Delhi NCR
Call Us -/9953056974- Call Girls In Vikaspuri-/- Delhi NCR
 

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