SlideShare une entreprise Scribd logo
1  sur  8
Program to find the smallest of N
numbers
Experiment No.8
Data segment
Array db 0A7H,87H,34H,83H,80H,78H,0CDH,0D4H,67H
Result db ?
Data Ends
Code Segment
Assume cs:code, ds:data
Start: MOV AX,DATA
MOV DS,AX ; Initialise DS
MOV CX,0008H ; count =08h
LEA BX,ARRAY ; Address of array in BX
MOV AH,[BX] ; take 1st no. in AH
BACK: INC BX ; point to next no.
CMP AH,[BX] ;compare no. in AH with no. in mem loc
JB GO ;if AH is small, jump to GO label
MOV AH,[BX] ; if mem loc is larger
GO: LOOP BACK ; cx cx-1, if cx<>0 jump to BACK
INC BX ; store result
MOV [BX],AH
INT 3
Code ends
End start
Program to find the largest of N
numbers
Experiment No.8
Data segment
Array db 0A7H,87H,34H,83H,80H,78H,0CDH,0D4H,67H
Result db ?
Data Ends
Code Segment
Assume cs:code, ds:data
Start: MOV AX,DATA
MOV DS,AX ; Initialise DS
MOV CX,0008H ; count =08h
LEA BX,ARRAY ; Address of array in BX
MOV AH,[BX] ; take 1st no. in AH
BACK: INC BX ; point to next no.
CMP AH,[BX] ;compare no. in AH with no. in mem loc
JA GO ;if AH is larger, jump to GO label
MOV AH,[BX] ; if mem loc is smaller
GO: LOOP BACK ; cx cx-1, if cx<>0 jump to BACK
INC BX ; store result
MOV [BX],AH
INT 3
Code ends
End start
Jump if AH is Big
otherwise store
mem loc
09 (length)
1 34
2 46
3 A7
4 D2
5 EF
6 DE
7 DF
8 ED
9 14
Largest EF
Experiment No.8
Questions to be answered
• Q.1, Q6, Q7 & Q9
• Q1. Ans:-- Assembler Directives
• Assume : It informs the assembler, the name of the
logical segment that should be used
General form: ASSUME seg_reg : seg_name,…
• Segment : Used to indicate the beginning of the logical
segment
General form: seg_name SEGMENT
• ENDS :Used to inform the end of the segment
General form: seg_name ENDS
• END : Used to inform the assembler, the end of the
program.
General form: END [starting address]
Where starting address is the label specified to indicate the
beginning of the program for CS register.
Questions to be answered
• Q6. Ans:-- Direct addressing mode
• Q7. Ans:-- Correct Instructions
1. MOV CL,09H
2. MOV AX,9876H
• Q9. Ans:-- Address Calculation for
1. MOV AX,[BX]
– Taking DS:BX, 0200:0020 is the address of the source
operand
– Shift DS by 4 bit positions DS = 02000h
– Add BX offset to obtain 02000 +
0020
----------
02020H
Questions to be answered
• Q9. Ans:-- Address Calculation for
2. MOV AL,[BP +SI]
– Taking SS: [BP+SI], Assuming SI as 0440h,
0400:[0010+0440] is the address of the
source operand.
– Shift SS by 4 bit positions for the base
address SS = 04000h
– Add [BP+SI] (0450) to obtain 04000 +
0450
---------
04450h

Contenu connexe

Tendances

Assembly language programs 2
Assembly language programs 2Assembly language programs 2
Assembly language programs 2HarshitParkar6677
 
e computer notes - Date time functions
e computer notes - Date time functionse computer notes - Date time functions
e computer notes - Date time functionsecomputernotes
 
Hybrid Inheritance in C++
Hybrid Inheritance in C++Hybrid Inheritance in C++
Hybrid Inheritance in C++Abhishek Pratap
 
Bayesian learning
Bayesian learning Bayesian learning
Bayesian learning EngReads
 
bubble point calculations (MATLAB)
bubble point calculations (MATLAB)bubble point calculations (MATLAB)
bubble point calculations (MATLAB)Marnel Francisco
 
Crystal Ball Event Prediction and Log Analysis with Hadoop MapReduce and Spark
Crystal Ball Event Prediction and Log Analysis with Hadoop MapReduce and SparkCrystal Ball Event Prediction and Log Analysis with Hadoop MapReduce and Spark
Crystal Ball Event Prediction and Log Analysis with Hadoop MapReduce and SparkJivan Nepali
 
A* (aster) Search Algorithm
A* (aster) Search AlgorithmA* (aster) Search Algorithm
A* (aster) Search AlgorithmSanzid Kawsar
 
Network problems 1 (1)
Network problems 1 (1)Network problems 1 (1)
Network problems 1 (1)Jabnon Nonjab
 

Tendances (11)

Assembly language programs
Assembly language programsAssembly language programs
Assembly language programs
 
Assembly language programs 2
Assembly language programs 2Assembly language programs 2
Assembly language programs 2
 
e computer notes - Date time functions
e computer notes - Date time functionse computer notes - Date time functions
e computer notes - Date time functions
 
Hybrid Inheritance in C++
Hybrid Inheritance in C++Hybrid Inheritance in C++
Hybrid Inheritance in C++
 
Lab loop
Lab loopLab loop
Lab loop
 
Bayesian learning
Bayesian learning Bayesian learning
Bayesian learning
 
bubble point calculations (MATLAB)
bubble point calculations (MATLAB)bubble point calculations (MATLAB)
bubble point calculations (MATLAB)
 
Concurrency in Python4k
Concurrency in Python4kConcurrency in Python4k
Concurrency in Python4k
 
Crystal Ball Event Prediction and Log Analysis with Hadoop MapReduce and Spark
Crystal Ball Event Prediction and Log Analysis with Hadoop MapReduce and SparkCrystal Ball Event Prediction and Log Analysis with Hadoop MapReduce and Spark
Crystal Ball Event Prediction and Log Analysis with Hadoop MapReduce and Spark
 
A* (aster) Search Algorithm
A* (aster) Search AlgorithmA* (aster) Search Algorithm
A* (aster) Search Algorithm
 
Network problems 1 (1)
Network problems 1 (1)Network problems 1 (1)
Network problems 1 (1)
 

Similaire à Practical notes

Stack and subroutine
Stack and subroutineStack and subroutine
Stack and subroutineAshim Saha
 
Assembly Language Compiler Implementation
Assembly Language Compiler ImplementationAssembly Language Compiler Implementation
Assembly Language Compiler ImplementationRAVI TEJA KOMMA
 
Part III: Assembly Language
Part III: Assembly LanguagePart III: Assembly Language
Part III: Assembly LanguageAhmed M. Abed
 
Introduction of 8086 micro processor .
Introduction of 8086 micro processor .Introduction of 8086 micro processor .
Introduction of 8086 micro processor .Siraj Ahmed
 
1344 Alp Of 8086
1344 Alp Of 80861344 Alp Of 8086
1344 Alp Of 8086techbed
 
Assembly Language Basics
Assembly Language BasicsAssembly Language Basics
Assembly Language BasicsEducation Front
 
Intel8086_Flags_Addr_Modes_sample_pgms.pdf
Intel8086_Flags_Addr_Modes_sample_pgms.pdfIntel8086_Flags_Addr_Modes_sample_pgms.pdf
Intel8086_Flags_Addr_Modes_sample_pgms.pdfAnonymous611358
 
Mastering Assembly Language: Programming with 8086
Mastering Assembly Language: Programming with 8086Mastering Assembly Language: Programming with 8086
Mastering Assembly Language: Programming with 8086sravanithonta79
 
Instruction addressing and execution
Instruction addressing and executionInstruction addressing and execution
Instruction addressing and executionSilvia
 
Buy Embedded Systems Projects Online,Buy B tech Projects Online
Buy Embedded Systems Projects Online,Buy B tech Projects OnlineBuy Embedded Systems Projects Online,Buy B tech Projects Online
Buy Embedded Systems Projects Online,Buy B tech Projects OnlineTechnogroovy
 
8086 programming guide programs samples and string permutations.pptx
8086 programming guide programs samples and string permutations.pptx8086 programming guide programs samples and string permutations.pptx
8086 programming guide programs samples and string permutations.pptxrularofclash69
 
Microcontroller 8051- soft.ppt
Microcontroller 8051- soft.pptMicrocontroller 8051- soft.ppt
Microcontroller 8051- soft.pptsteffydean
 

Similaire à Practical notes (20)

Stack and subroutine
Stack and subroutineStack and subroutine
Stack and subroutine
 
Lec06
Lec06Lec06
Lec06
 
Assembly Language Compiler Implementation
Assembly Language Compiler ImplementationAssembly Language Compiler Implementation
Assembly Language Compiler Implementation
 
Part III: Assembly Language
Part III: Assembly LanguagePart III: Assembly Language
Part III: Assembly Language
 
8086 pgms
8086 pgms8086 pgms
8086 pgms
 
Introduction of 8086 micro processor .
Introduction of 8086 micro processor .Introduction of 8086 micro processor .
Introduction of 8086 micro processor .
 
1344 Alp Of 8086
1344 Alp Of 80861344 Alp Of 8086
1344 Alp Of 8086
 
Lecture6
Lecture6Lecture6
Lecture6
 
Lecture5
Lecture5Lecture5
Lecture5
 
Lecture5(1)
Lecture5(1)Lecture5(1)
Lecture5(1)
 
Assembly Language Basics
Assembly Language BasicsAssembly Language Basics
Assembly Language Basics
 
Intel8086_Flags_Addr_Modes_sample_pgms.pdf
Intel8086_Flags_Addr_Modes_sample_pgms.pdfIntel8086_Flags_Addr_Modes_sample_pgms.pdf
Intel8086_Flags_Addr_Modes_sample_pgms.pdf
 
Mastering Assembly Language: Programming with 8086
Mastering Assembly Language: Programming with 8086Mastering Assembly Language: Programming with 8086
Mastering Assembly Language: Programming with 8086
 
unit-2.pptx
unit-2.pptxunit-2.pptx
unit-2.pptx
 
Instruction addressing and execution
Instruction addressing and executionInstruction addressing and execution
Instruction addressing and execution
 
Buy Embedded Systems Projects Online,Buy B tech Projects Online
Buy Embedded Systems Projects Online,Buy B tech Projects OnlineBuy Embedded Systems Projects Online,Buy B tech Projects Online
Buy Embedded Systems Projects Online,Buy B tech Projects Online
 
8086 programming guide programs samples and string permutations.pptx
8086 programming guide programs samples and string permutations.pptx8086 programming guide programs samples and string permutations.pptx
8086 programming guide programs samples and string permutations.pptx
 
Microcontroller 8051- soft.ppt
Microcontroller 8051- soft.pptMicrocontroller 8051- soft.ppt
Microcontroller 8051- soft.ppt
 
Wk1to4
Wk1to4Wk1to4
Wk1to4
 
[ASM]Lab6
[ASM]Lab6[ASM]Lab6
[ASM]Lab6
 

Plus de HarshitParkar6677 (20)

Wi fi hacking
Wi fi hackingWi fi hacking
Wi fi hacking
 
D dos attack
D dos attackD dos attack
D dos attack
 
Notes chapter 6
Notes chapter  6Notes chapter  6
Notes chapter 6
 
Interface notes
Interface notesInterface notes
Interface notes
 
Chapter6 2
Chapter6 2Chapter6 2
Chapter6 2
 
Chapter6
Chapter6Chapter6
Chapter6
 
8086 cpu 1
8086 cpu 18086 cpu 1
8086 cpu 1
 
Chapter 6 notes
Chapter 6 notesChapter 6 notes
Chapter 6 notes
 
Chapter 5 notes
Chapter 5 notesChapter 5 notes
Chapter 5 notes
 
Chap6 procedures &amp; macros
Chap6 procedures &amp; macrosChap6 procedures &amp; macros
Chap6 procedures &amp; macros
 
Chapter 5 notes new
Chapter 5 notes newChapter 5 notes new
Chapter 5 notes new
 
Notes arithmetic instructions
Notes arithmetic instructionsNotes arithmetic instructions
Notes arithmetic instructions
 
Notes all instructions
Notes all instructionsNotes all instructions
Notes all instructions
 
Notes aaa aa
Notes aaa aaNotes aaa aa
Notes aaa aa
 
Notes 8086 instruction format
Notes 8086 instruction formatNotes 8086 instruction format
Notes 8086 instruction format
 
Misc
MiscMisc
Misc
 
Copy of 8086inst logical
Copy of 8086inst logicalCopy of 8086inst logical
Copy of 8086inst logical
 
Copy of 8086inst logical
Copy of 8086inst logicalCopy of 8086inst logical
Copy of 8086inst logical
 
Chapter3 program flow control instructions
Chapter3 program flow control instructionsChapter3 program flow control instructions
Chapter3 program flow control instructions
 
Chapter3 8086inst stringsl
Chapter3 8086inst stringslChapter3 8086inst stringsl
Chapter3 8086inst stringsl
 

Dernier

Introduction and different types of Ethernet.pptx
Introduction and different types of Ethernet.pptxIntroduction and different types of Ethernet.pptx
Introduction and different types of Ethernet.pptxupamatechverse
 
BSides Seattle 2024 - Stopping Ethan Hunt From Taking Your Data.pptx
BSides Seattle 2024 - Stopping Ethan Hunt From Taking Your Data.pptxBSides Seattle 2024 - Stopping Ethan Hunt From Taking Your Data.pptx
BSides Seattle 2024 - Stopping Ethan Hunt From Taking Your Data.pptxfenichawla
 
(SHREYA) Chakan Call Girls Just Call 7001035870 [ Cash on Delivery ] Pune Esc...
(SHREYA) Chakan Call Girls Just Call 7001035870 [ Cash on Delivery ] Pune Esc...(SHREYA) Chakan Call Girls Just Call 7001035870 [ Cash on Delivery ] Pune Esc...
(SHREYA) Chakan Call Girls Just Call 7001035870 [ Cash on Delivery ] Pune Esc...ranjana rawat
 
(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-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
 
result management system report for college project
result management system report for college projectresult management system report for college project
result management system report for college projectTonystark477637
 
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
 
ONLINE FOOD ORDER SYSTEM PROJECT REPORT.pdf
ONLINE FOOD ORDER SYSTEM PROJECT REPORT.pdfONLINE FOOD ORDER SYSTEM PROJECT REPORT.pdf
ONLINE FOOD ORDER SYSTEM PROJECT REPORT.pdfKamal Acharya
 
Russian Call Girls in Nagpur Grishma Call 7001035870 Meet With Nagpur Escorts
Russian Call Girls in Nagpur Grishma Call 7001035870 Meet With Nagpur EscortsRussian Call Girls in Nagpur Grishma Call 7001035870 Meet With Nagpur Escorts
Russian Call Girls in Nagpur Grishma Call 7001035870 Meet With Nagpur EscortsCall Girls in Nagpur High Profile
 
Call Girls Pimpri Chinchwad Call Me 7737669865 Budget Friendly No Advance Boo...
Call Girls Pimpri Chinchwad Call Me 7737669865 Budget Friendly No Advance Boo...Call Girls Pimpri Chinchwad Call Me 7737669865 Budget Friendly No Advance Boo...
Call Girls Pimpri Chinchwad Call Me 7737669865 Budget Friendly No Advance Boo...roncy bisnoi
 
MANUFACTURING PROCESS-II UNIT-1 THEORY OF METAL CUTTING
MANUFACTURING PROCESS-II UNIT-1 THEORY OF METAL CUTTINGMANUFACTURING PROCESS-II UNIT-1 THEORY OF METAL CUTTING
MANUFACTURING PROCESS-II UNIT-1 THEORY OF METAL CUTTINGSIVASHANKAR N
 
The Most Attractive Pune Call Girls Budhwar Peth 8250192130 Will You Miss Thi...
The Most Attractive Pune Call Girls Budhwar Peth 8250192130 Will You Miss Thi...The Most Attractive Pune Call Girls Budhwar Peth 8250192130 Will You Miss Thi...
The Most Attractive Pune Call Girls Budhwar Peth 8250192130 Will You Miss Thi...ranjana rawat
 
The Most Attractive Pune Call Girls Manchar 8250192130 Will You Miss This Cha...
The Most Attractive Pune Call Girls Manchar 8250192130 Will You Miss This Cha...The Most Attractive Pune Call Girls Manchar 8250192130 Will You Miss This Cha...
The Most Attractive Pune Call Girls Manchar 8250192130 Will You Miss This Cha...ranjana rawat
 
MANUFACTURING PROCESS-II UNIT-5 NC MACHINE TOOLS
MANUFACTURING PROCESS-II UNIT-5 NC MACHINE TOOLSMANUFACTURING PROCESS-II UNIT-5 NC MACHINE TOOLS
MANUFACTURING PROCESS-II UNIT-5 NC MACHINE TOOLSSIVASHANKAR N
 
Introduction to Multiple Access Protocol.pptx
Introduction to Multiple Access Protocol.pptxIntroduction to Multiple Access Protocol.pptx
Introduction to Multiple Access Protocol.pptxupamatechverse
 
Coefficient of Thermal Expansion and their Importance.pptx
Coefficient of Thermal Expansion and their Importance.pptxCoefficient of Thermal Expansion and their Importance.pptx
Coefficient of Thermal Expansion and their Importance.pptxAsutosh Ranjan
 
Booking open Available Pune Call Girls Pargaon 6297143586 Call Hot Indian Gi...
Booking open Available Pune Call Girls Pargaon  6297143586 Call Hot Indian Gi...Booking open Available Pune Call Girls Pargaon  6297143586 Call Hot Indian Gi...
Booking open Available Pune Call Girls Pargaon 6297143586 Call Hot Indian Gi...Call Girls in Nagpur High Profile
 
Online banking management system project.pdf
Online banking management system project.pdfOnline banking management system project.pdf
Online banking management system project.pdfKamal Acharya
 
University management System project report..pdf
University management System project report..pdfUniversity management System project report..pdf
University management System project report..pdfKamal Acharya
 

Dernier (20)

Introduction and different types of Ethernet.pptx
Introduction and different types of Ethernet.pptxIntroduction and different types of Ethernet.pptx
Introduction and different types of Ethernet.pptx
 
BSides Seattle 2024 - Stopping Ethan Hunt From Taking Your Data.pptx
BSides Seattle 2024 - Stopping Ethan Hunt From Taking Your Data.pptxBSides Seattle 2024 - Stopping Ethan Hunt From Taking Your Data.pptx
BSides Seattle 2024 - Stopping Ethan Hunt From Taking Your Data.pptx
 
(SHREYA) Chakan Call Girls Just Call 7001035870 [ Cash on Delivery ] Pune Esc...
(SHREYA) Chakan Call Girls Just Call 7001035870 [ Cash on Delivery ] Pune Esc...(SHREYA) Chakan Call Girls Just Call 7001035870 [ Cash on Delivery ] Pune Esc...
(SHREYA) Chakan Call Girls Just Call 7001035870 [ Cash on Delivery ] Pune Esc...
 
(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-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
 
result management system report for college project
result management system report for college projectresult management system report for college project
result management system report for college project
 
(INDIRA) Call Girl Aurangabad Call Now 8617697112 Aurangabad Escorts 24x7
(INDIRA) Call Girl Aurangabad Call Now 8617697112 Aurangabad Escorts 24x7(INDIRA) Call Girl Aurangabad Call Now 8617697112 Aurangabad Escorts 24x7
(INDIRA) Call Girl Aurangabad Call Now 8617697112 Aurangabad Escorts 24x7
 
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
 
ONLINE FOOD ORDER SYSTEM PROJECT REPORT.pdf
ONLINE FOOD ORDER SYSTEM PROJECT REPORT.pdfONLINE FOOD ORDER SYSTEM PROJECT REPORT.pdf
ONLINE FOOD ORDER SYSTEM PROJECT REPORT.pdf
 
Russian Call Girls in Nagpur Grishma Call 7001035870 Meet With Nagpur Escorts
Russian Call Girls in Nagpur Grishma Call 7001035870 Meet With Nagpur EscortsRussian Call Girls in Nagpur Grishma Call 7001035870 Meet With Nagpur Escorts
Russian Call Girls in Nagpur Grishma Call 7001035870 Meet With Nagpur Escorts
 
Call Girls Pimpri Chinchwad Call Me 7737669865 Budget Friendly No Advance Boo...
Call Girls Pimpri Chinchwad Call Me 7737669865 Budget Friendly No Advance Boo...Call Girls Pimpri Chinchwad Call Me 7737669865 Budget Friendly No Advance Boo...
Call Girls Pimpri Chinchwad Call Me 7737669865 Budget Friendly No Advance Boo...
 
MANUFACTURING PROCESS-II UNIT-1 THEORY OF METAL CUTTING
MANUFACTURING PROCESS-II UNIT-1 THEORY OF METAL CUTTINGMANUFACTURING PROCESS-II UNIT-1 THEORY OF METAL CUTTING
MANUFACTURING PROCESS-II UNIT-1 THEORY OF METAL CUTTING
 
The Most Attractive Pune Call Girls Budhwar Peth 8250192130 Will You Miss Thi...
The Most Attractive Pune Call Girls Budhwar Peth 8250192130 Will You Miss Thi...The Most Attractive Pune Call Girls Budhwar Peth 8250192130 Will You Miss Thi...
The Most Attractive Pune Call Girls Budhwar Peth 8250192130 Will You Miss Thi...
 
The Most Attractive Pune Call Girls Manchar 8250192130 Will You Miss This Cha...
The Most Attractive Pune Call Girls Manchar 8250192130 Will You Miss This Cha...The Most Attractive Pune Call Girls Manchar 8250192130 Will You Miss This Cha...
The Most Attractive Pune Call Girls Manchar 8250192130 Will You Miss This Cha...
 
MANUFACTURING PROCESS-II UNIT-5 NC MACHINE TOOLS
MANUFACTURING PROCESS-II UNIT-5 NC MACHINE TOOLSMANUFACTURING PROCESS-II UNIT-5 NC MACHINE TOOLS
MANUFACTURING PROCESS-II UNIT-5 NC MACHINE TOOLS
 
Introduction to Multiple Access Protocol.pptx
Introduction to Multiple Access Protocol.pptxIntroduction to Multiple Access Protocol.pptx
Introduction to Multiple Access Protocol.pptx
 
Coefficient of Thermal Expansion and their Importance.pptx
Coefficient of Thermal Expansion and their Importance.pptxCoefficient of Thermal Expansion and their Importance.pptx
Coefficient of Thermal Expansion and their Importance.pptx
 
Booking open Available Pune Call Girls Pargaon 6297143586 Call Hot Indian Gi...
Booking open Available Pune Call Girls Pargaon  6297143586 Call Hot Indian Gi...Booking open Available Pune Call Girls Pargaon  6297143586 Call Hot Indian Gi...
Booking open Available Pune Call Girls Pargaon 6297143586 Call Hot Indian Gi...
 
Online banking management system project.pdf
Online banking management system project.pdfOnline banking management system project.pdf
Online banking management system project.pdf
 
University management System project report..pdf
University management System project report..pdfUniversity management System project report..pdf
University management System project report..pdf
 

Practical notes

  • 1. Program to find the smallest of N numbers Experiment No.8
  • 2. Data segment Array db 0A7H,87H,34H,83H,80H,78H,0CDH,0D4H,67H Result db ? Data Ends Code Segment Assume cs:code, ds:data Start: MOV AX,DATA MOV DS,AX ; Initialise DS MOV CX,0008H ; count =08h LEA BX,ARRAY ; Address of array in BX MOV AH,[BX] ; take 1st no. in AH BACK: INC BX ; point to next no. CMP AH,[BX] ;compare no. in AH with no. in mem loc JB GO ;if AH is small, jump to GO label MOV AH,[BX] ; if mem loc is larger GO: LOOP BACK ; cx cx-1, if cx<>0 jump to BACK INC BX ; store result MOV [BX],AH INT 3 Code ends End start
  • 3. Program to find the largest of N numbers Experiment No.8
  • 4. Data segment Array db 0A7H,87H,34H,83H,80H,78H,0CDH,0D4H,67H Result db ? Data Ends Code Segment Assume cs:code, ds:data Start: MOV AX,DATA MOV DS,AX ; Initialise DS MOV CX,0008H ; count =08h LEA BX,ARRAY ; Address of array in BX MOV AH,[BX] ; take 1st no. in AH BACK: INC BX ; point to next no. CMP AH,[BX] ;compare no. in AH with no. in mem loc JA GO ;if AH is larger, jump to GO label MOV AH,[BX] ; if mem loc is smaller GO: LOOP BACK ; cx cx-1, if cx<>0 jump to BACK INC BX ; store result MOV [BX],AH INT 3 Code ends End start Jump if AH is Big otherwise store mem loc
  • 5. 09 (length) 1 34 2 46 3 A7 4 D2 5 EF 6 DE 7 DF 8 ED 9 14 Largest EF Experiment No.8
  • 6. Questions to be answered • Q.1, Q6, Q7 & Q9 • Q1. Ans:-- Assembler Directives • Assume : It informs the assembler, the name of the logical segment that should be used General form: ASSUME seg_reg : seg_name,… • Segment : Used to indicate the beginning of the logical segment General form: seg_name SEGMENT • ENDS :Used to inform the end of the segment General form: seg_name ENDS • END : Used to inform the assembler, the end of the program. General form: END [starting address] Where starting address is the label specified to indicate the beginning of the program for CS register.
  • 7. Questions to be answered • Q6. Ans:-- Direct addressing mode • Q7. Ans:-- Correct Instructions 1. MOV CL,09H 2. MOV AX,9876H • Q9. Ans:-- Address Calculation for 1. MOV AX,[BX] – Taking DS:BX, 0200:0020 is the address of the source operand – Shift DS by 4 bit positions DS = 02000h – Add BX offset to obtain 02000 + 0020 ---------- 02020H
  • 8. Questions to be answered • Q9. Ans:-- Address Calculation for 2. MOV AL,[BP +SI] – Taking SS: [BP+SI], Assuming SI as 0440h, 0400:[0010+0440] is the address of the source operand. – Shift SS by 4 bit positions for the base address SS = 04000h – Add [BP+SI] (0450) to obtain 04000 + 0450 --------- 04450h