SlideShare a Scribd company logo
Lab Report 03 Group No 10 10/10/2017
1 | L a b 0 3
IMPLEMENTING ARITHMETIC INSTRUCTIONS IN EMU 8086
Objective:
Learn how to:
 Write programs in Emu8086 using arithmetic instructions
 Write a complete assembly program.
 Use Emu8086 to execute written programs
 Use Emu8086 to execute single instruction at a time.
 Edit an existing source program.
Lab Outcomes:
Practice 8086 Emulator
Loading, verifying and saving machine code of arithmetic instructions.
Executing arithmetic instructions and tracing programs.
Arithmetic instructions: These instructions are used to perform various mathematical
operations like addition, subtraction, multiplication and division etc.
Addition instructions
1. ADD: Add specified byte to byte or word to word
2. ADC: Add with carry
3. INC: Increment specified byte or specified word by 1
4. AAA: ASCII adjust after addition
5. DAA : Decimal (BCD) adjust after addition
Subtraction instructions
1. SUB : Subtract byte from byte or word from word
2. SBB : Subtract with borrow
3. DEC : Decrement specified byte or word by 1
4. NEG : Negate or invert each bit of a specified byte or word and add 1 (2’s complement)
5. CMP : Compare two specified byte or two specified words
6. AAS : ASCII adjust after subtraction
7. DAS : Decimal adjust after subtraction
Multiplication instructions
1. MUL : Multiply unsigned byte by byte or unsigned word or word.
2. IMUL : Multiply signed bye by byte or signed word by word
3. AAM : ASCII adjust after multiplication
Division instructions
1. DIV : Divide unsigned word by byte or unsigned double word by word
2. IDIV : Divide signed word by byte or signed double word by word
3. AAD : ASCII adjust after division
4. CBW : Fill upper byte of word with copies of sign bit of lower byte
5. CWD : Fill upper word of double word with sign bit of lower word.
Lab Report 03 Group No 10 10/10/2017
2 | L a b 0 3
TASK No 1:
Write an assembly language program for 8086 in which you will store two
nonzero 8-bit numbers to AL and BL registers and perform the following
operations
1. Add both values and store the answer in CH register.
2. Subtract the value placed in BL from AL and store the answer in CL.
3. Multiply the values and store it in AX register.(with and without using
MUL instruction)
4. Divide the value at AL with BL and store the quotient in CH and
remainder in DH register.
Step No 01:
Lab Report 03 Group No 10 10/10/2017
3 | L a b 0 3
Step No 2: Moving values to AL and BL registers.
Step No 03: Adding values of AL and BL and storing into CH register.
Lab Report 03 Group No 10 10/10/2017
4 | L a b 0 3
Step No 04: Moving back value of AL from DL.
Step No 06: Subtracting values of AL and BL and storing it in CL register.
Lab Report 03 Group No 10 10/10/2017
5 | L a b 0 3
Step No 07: Multiplying both values of AL and BL registers with MUL command.
Step No 8: Multiplying both values of AL and BL registers without MUL command.
Lab Report 03 Group No 10 10/10/2017
6 | L a b 0 3
Step No 09: Moving value of AL back from DL.
Step No 10: Deviding values of AL and BL and storing quotient in CH and remainder in DH.
Lab Report 03 Group No 10 10/10/2017
7 | L a b 0 3
Table No 01
Task No 2:
Write an assembly language program for 8086 in which you will add two BCD
numbers placed in AL and BL registers. Store the final answer in DL register. If
the sum exceeds 8 bit value,store the high byte in DH register. The result must
be in BCD.
(Hint: Use JC and JNC instructions)
Example 01: Without carry
Step No 01: Coding
Instructions
AX BX CX DX CS IP SS SP BP SI DI DS ES
AL AH BL BH CL CH DL DH
MOV AL,09H 09 00 00 00 00 00 00 00 0100 0002 0100 FFFE 0000 0000 0000 0100 0100
MOV BL,02H 09 00 02 00 00 00 00 00 0100 0004 0100 FFFE 0000 0000 0000 0100 0100
MOV DL,AL 09 00 02 00 00 00 09 00 0100 0006 0100 FFFE 0000 0000 0000 0100 0100
ADD AL,BL 0B 00 02 00 00 00 09 00 0100 0008 0100 FFFE 0000 0000 0000 0100 0100
MOV CH,AL 0B 00 02 00 00 0B 09 00 0100 000A 0100 FFFE 0000 0000 0000 0100 0100
MOV AL,DL 09 00 02 00 00 0B 09 00 0100 000C 0100 FFFE 0000 0000 0000 0100 0100
SUB AL,BL 07 00 02 00 00 0B 09 00 0100 000E 0100 FFFE 0000 0000 0000 0100 0100
MOV CL,AL 07 00 02 00 07 0B 09 00 0100 0010 0100 FFFE 0000 0000 0000 0100 0100
MOV AL,DL 09 00 02 00 07 0B 09 00 0100 0012 0100 FFFE 0000 0000 0000 0100 0100
MUL BL 12 00 02 00 07 0B 09 00 0100 0014 0100 FFFE 0000 0000 0000 0100 0100
MOV AL,DL 09 00 02 00 07 0B 09 00 0100 0016 0100 FFFE 0000 0000 0000 0100 0100
MOV DH,BL 09 00 02 00 07 0B 09 02 0100 0018 0100 FFFE 0000 0000 0000 0100 0100
DEC DH 09 00 02 00 07 0B 09 01 0100 001A 0100 FFFE 0000 0000 0000 0100 0100
DEC DH 09 00 02 00 07 0B 09 00 0100 001E 0100 FFFE 0000 0000 0000 0100 0100
DIV BL 04 01 02 00 07 0B 09 00 0100 0020 0100 FFFE 0000 0000 0000 0100 0100
MOV CH,AL 04 01 02 00 07 04 09 00 0100 0022 0100 FFFE 0000 0000 0000 0100 0100
MOV DH,AH 04 01 02 00 07 04 09 01 0100 0024 0100 FFFE 0000 0000 0000 0100 0100
Lab Report 03 Group No 10 10/10/2017
8 | L a b 0 3
Step No 02: Storing values in AL,BL registers.
Step No 3: Adding values in AL and BL.
Lab Report 03 Group No 10 10/10/2017
9 | L a b 0 3
Step No 04: Storing value of AL in DL register.
Step No 05: Storing value of DX in AX and Adjusting BCD of the value stored in register
AX.
Lab Report 03 Group No 10 10/10/2017
10 | L a b 0 3
Example 2: With carry
Step No 01: Coding
Lab Report 03 Group No 10 10/10/2017
11 | L a b 0 3
Step No 02: Storing values in AL and BL registers.
Step No 3:Adding values of AL and BL, storing in DL and carry in DH.
Lab Report 03 Group No 10 10/10/2017
12 | L a b 0 3
Step No 04: Adjusting BCD using DAA command.
Lab Report 03 Group No 10 10/10/2017
13 | L a b 0 3
Table No 02
Instructions
AX BX CX DX CS IP SS SP BP SI DI DS ES
AL AH BL BH CL CH DL DH
MOV AL,0F0H F0 00 00 00 00 00 00 00 0100 0002 0100 FFFE 0000 0000 0000 0100 0100
MOV BL,014H F0 00 14 00 00 00 00 00 0100 0004 0100 FFFE 0000 0000 0000 0100 0100
ADD AL,BL 04 00 14 00 00 00 00 00 0100 0006 0100 FFFE 0000 0000 0000 0100 0100
INCDH 04 00 14 00 00 0B 00 01 0100 000A 0100 FFFE 0000 0000 0000 0100 0100
MOV DL,AL 04 00 14 00 00 0B 04 01 0100 000C 0100 FFFE 0000 0000 0000 0100 0100
MOV AX,DX 04 01 14 00 00 0B 04 01 0100 000E 0100 FFFE 0000 0000 0000 0100 0100
DAA 64 01 14 00 00 0B 04 01 0100 0010 0100 FFFE 0000 0000 0000 0100 0100

More Related Content

What's hot

Types of instructions
Types of instructionsTypes of instructions
Types of instructions
ihsanjamil
 
assembly language programming organization of IBM PC chapter 9 part-1(MULTIPL...
assembly language programming organization of IBM PC chapter 9 part-1(MULTIPL...assembly language programming organization of IBM PC chapter 9 part-1(MULTIPL...
assembly language programming organization of IBM PC chapter 9 part-1(MULTIPL...
Bilal Amjad
 
Logical, Shift, and Rotate Instruction
Logical, Shift, and Rotate InstructionLogical, Shift, and Rotate Instruction
Logical, Shift, and Rotate Instruction
Badrul Alam
 
8086 Instruction set
8086 Instruction set8086 Instruction set
8086 Instruction set
karthiga selvaraju
 
Unit 3 – assembly language programming
Unit 3 – assembly language programmingUnit 3 – assembly language programming
Unit 3 – assembly language programming
Kartik Sharma
 
Addressing modes
Addressing modesAddressing modes
Addressing modes
karthiga selvaraju
 
DAA AND DAS
DAA AND DASDAA AND DAS
DAA AND DAS
Basavaraj Shetty
 
1327 Addressing Modes Of 8086
1327 Addressing Modes Of 80861327 Addressing Modes Of 8086
1327 Addressing Modes Of 8086
techbed
 
Assembly language 8086
Assembly language 8086Assembly language 8086
Assembly language 8086
John Cutajar
 
Assembly Language Programming By Ytha Yu, Charles Marut Chap 4 (Introduction ...
Assembly Language Programming By Ytha Yu, Charles Marut Chap 4 (Introduction ...Assembly Language Programming By Ytha Yu, Charles Marut Chap 4 (Introduction ...
Assembly Language Programming By Ytha Yu, Charles Marut Chap 4 (Introduction ...
Bilal Amjad
 
Microprocessor 8086
Microprocessor 8086Microprocessor 8086
Microprocessor 8086
Gopikrishna Madanan
 
Programming with 8085
Programming with 8085Programming with 8085
Programming with 8085
Shehrevar Davierwala
 
Part I:Introduction to assembly language
Part I:Introduction to assembly languagePart I:Introduction to assembly language
Part I:Introduction to assembly language
Ahmed M. Abed
 
Sap 2 OF MICROPROCESSOR
Sap 2 OF MICROPROCESSORSap 2 OF MICROPROCESSOR
Sap 2 OF MICROPROCESSOR
Apar Pramod
 
Assembly Language Programming By Ytha Yu, Charles Marut Chap 7 (Logic, Shift,...
Assembly Language Programming By Ytha Yu, Charles Marut Chap 7 (Logic, Shift,...Assembly Language Programming By Ytha Yu, Charles Marut Chap 7 (Logic, Shift,...
Assembly Language Programming By Ytha Yu, Charles Marut Chap 7 (Logic, Shift,...
Bilal Amjad
 
Instruction set of 8086
Instruction set of 8086Instruction set of 8086
Instruction set of 8086
Vijay Kumar
 
8086
80868086
Instruction set of 8086
Instruction set of 8086Instruction set of 8086
Instruction set of 8086
9840596838
 
Addressing modes of 8086
Addressing modes of 8086Addressing modes of 8086
Addressing modes of 8086
Dr. AISHWARYA N
 
8086
80868086

What's hot (20)

Types of instructions
Types of instructionsTypes of instructions
Types of instructions
 
assembly language programming organization of IBM PC chapter 9 part-1(MULTIPL...
assembly language programming organization of IBM PC chapter 9 part-1(MULTIPL...assembly language programming organization of IBM PC chapter 9 part-1(MULTIPL...
assembly language programming organization of IBM PC chapter 9 part-1(MULTIPL...
 
Logical, Shift, and Rotate Instruction
Logical, Shift, and Rotate InstructionLogical, Shift, and Rotate Instruction
Logical, Shift, and Rotate Instruction
 
8086 Instruction set
8086 Instruction set8086 Instruction set
8086 Instruction set
 
Unit 3 – assembly language programming
Unit 3 – assembly language programmingUnit 3 – assembly language programming
Unit 3 – assembly language programming
 
Addressing modes
Addressing modesAddressing modes
Addressing modes
 
DAA AND DAS
DAA AND DASDAA AND DAS
DAA AND DAS
 
1327 Addressing Modes Of 8086
1327 Addressing Modes Of 80861327 Addressing Modes Of 8086
1327 Addressing Modes Of 8086
 
Assembly language 8086
Assembly language 8086Assembly language 8086
Assembly language 8086
 
Assembly Language Programming By Ytha Yu, Charles Marut Chap 4 (Introduction ...
Assembly Language Programming By Ytha Yu, Charles Marut Chap 4 (Introduction ...Assembly Language Programming By Ytha Yu, Charles Marut Chap 4 (Introduction ...
Assembly Language Programming By Ytha Yu, Charles Marut Chap 4 (Introduction ...
 
Microprocessor 8086
Microprocessor 8086Microprocessor 8086
Microprocessor 8086
 
Programming with 8085
Programming with 8085Programming with 8085
Programming with 8085
 
Part I:Introduction to assembly language
Part I:Introduction to assembly languagePart I:Introduction to assembly language
Part I:Introduction to assembly language
 
Sap 2 OF MICROPROCESSOR
Sap 2 OF MICROPROCESSORSap 2 OF MICROPROCESSOR
Sap 2 OF MICROPROCESSOR
 
Assembly Language Programming By Ytha Yu, Charles Marut Chap 7 (Logic, Shift,...
Assembly Language Programming By Ytha Yu, Charles Marut Chap 7 (Logic, Shift,...Assembly Language Programming By Ytha Yu, Charles Marut Chap 7 (Logic, Shift,...
Assembly Language Programming By Ytha Yu, Charles Marut Chap 7 (Logic, Shift,...
 
Instruction set of 8086
Instruction set of 8086Instruction set of 8086
Instruction set of 8086
 
8086
80868086
8086
 
Instruction set of 8086
Instruction set of 8086Instruction set of 8086
Instruction set of 8086
 
Addressing modes of 8086
Addressing modes of 8086Addressing modes of 8086
Addressing modes of 8086
 
8086
80868086
8086
 

Similar to IMPLEMENTING ARITHMETIC INSTRUCTIONS IN EMU 8086

implementation of data instrucions in emu8086
implementation of data instrucions in emu8086implementation of data instrucions in emu8086
implementation of data instrucions in emu8086
COMSATS Abbottabad
 
15CS44 MP & MC Module 2
15CS44 MP & MC Module  215CS44 MP & MC Module  2
15CS44 MP & MC Module 2
RLJIT
 
Chap 8 The stack and introduction to procedures & Chapter 9 multiplication an...
Chap 8 The stack and introduction to procedures & Chapter 9 multiplication an...Chap 8 The stack and introduction to procedures & Chapter 9 multiplication an...
Chap 8 The stack and introduction to procedures & Chapter 9 multiplication an...
warda aziz
 
8086 instructions
8086 instructions8086 instructions
8086 instructions
Ravi Anand
 
Chapter 3 instruction set-of-8085
Chapter 3 instruction set-of-8085Chapter 3 instruction set-of-8085
Chapter 3 instruction set-of-8085
Shubham Singh
 
INTEL 8085 DATA FORMAT AND INSTRUCTIONS
INTEL 8085 DATA FORMAT AND INSTRUCTIONSINTEL 8085 DATA FORMAT AND INSTRUCTIONS
INTEL 8085 DATA FORMAT AND INSTRUCTIONS
Swapnil Mishra
 
8085 Assembly language programs.pdf
8085 Assembly language programs.pdf8085 Assembly language programs.pdf
8085 Assembly language programs.pdf
RahulMishra122561
 
Assembly Language Programming Of 8085
Assembly Language Programming Of 8085Assembly Language Programming Of 8085
Assembly Language Programming Of 8085
techbed
 
Instruction set of 8086
Instruction set of 8086Instruction set of 8086
Instruction set of 8086
aviban
 
Microcontroller 8051- soft.ppt
Microcontroller 8051- soft.pptMicrocontroller 8051- soft.ppt
Microcontroller 8051- soft.ppt
steffydean
 
Instruction set of 8085
Instruction set  of 8085Instruction set  of 8085
Instruction set of 8085
shiji v r
 
Instruction set class
Instruction set   classInstruction set   class
Instruction set class
shiji v r
 
8085 instruction set
8085 instruction set8085 instruction set
Programming with 8085-Microprocessor and interfacing
Programming with 8085-Microprocessor and interfacingProgramming with 8085-Microprocessor and interfacing
Programming with 8085-Microprocessor and interfacing
Amitabh Shukla
 
8085 instruction set
8085 instruction set8085 instruction set
8085 instruction set
JLoknathDora
 
Basic programming of 8085
Basic programming of 8085 Basic programming of 8085
Basic programming of 8085
vijaydeepakg
 
Arithmetic instrctions
Arithmetic instrctionsArithmetic instrctions
Arithmetic instrctions
HarshitParkar6677
 
Mastering Assembly Language: Programming with 8086
Mastering Assembly Language: Programming with 8086Mastering Assembly Language: Programming with 8086
Mastering Assembly Language: Programming with 8086
sravanithonta79
 
Instruction formats-in-8086
Instruction formats-in-8086Instruction formats-in-8086
Instruction formats-in-8086
MNM Jain Engineering College
 
Microprocessor Based Design and operations
Microprocessor Based Design and operationsMicroprocessor Based Design and operations
Microprocessor Based Design and operations
zelalem2022
 

Similar to IMPLEMENTING ARITHMETIC INSTRUCTIONS IN EMU 8086 (20)

implementation of data instrucions in emu8086
implementation of data instrucions in emu8086implementation of data instrucions in emu8086
implementation of data instrucions in emu8086
 
15CS44 MP & MC Module 2
15CS44 MP & MC Module  215CS44 MP & MC Module  2
15CS44 MP & MC Module 2
 
Chap 8 The stack and introduction to procedures & Chapter 9 multiplication an...
Chap 8 The stack and introduction to procedures & Chapter 9 multiplication an...Chap 8 The stack and introduction to procedures & Chapter 9 multiplication an...
Chap 8 The stack and introduction to procedures & Chapter 9 multiplication an...
 
8086 instructions
8086 instructions8086 instructions
8086 instructions
 
Chapter 3 instruction set-of-8085
Chapter 3 instruction set-of-8085Chapter 3 instruction set-of-8085
Chapter 3 instruction set-of-8085
 
INTEL 8085 DATA FORMAT AND INSTRUCTIONS
INTEL 8085 DATA FORMAT AND INSTRUCTIONSINTEL 8085 DATA FORMAT AND INSTRUCTIONS
INTEL 8085 DATA FORMAT AND INSTRUCTIONS
 
8085 Assembly language programs.pdf
8085 Assembly language programs.pdf8085 Assembly language programs.pdf
8085 Assembly language programs.pdf
 
Assembly Language Programming Of 8085
Assembly Language Programming Of 8085Assembly Language Programming Of 8085
Assembly Language Programming Of 8085
 
Instruction set of 8086
Instruction set of 8086Instruction set of 8086
Instruction set of 8086
 
Microcontroller 8051- soft.ppt
Microcontroller 8051- soft.pptMicrocontroller 8051- soft.ppt
Microcontroller 8051- soft.ppt
 
Instruction set of 8085
Instruction set  of 8085Instruction set  of 8085
Instruction set of 8085
 
Instruction set class
Instruction set   classInstruction set   class
Instruction set class
 
8085 instruction set
8085 instruction set8085 instruction set
8085 instruction set
 
Programming with 8085-Microprocessor and interfacing
Programming with 8085-Microprocessor and interfacingProgramming with 8085-Microprocessor and interfacing
Programming with 8085-Microprocessor and interfacing
 
8085 instruction set
8085 instruction set8085 instruction set
8085 instruction set
 
Basic programming of 8085
Basic programming of 8085 Basic programming of 8085
Basic programming of 8085
 
Arithmetic instrctions
Arithmetic instrctionsArithmetic instrctions
Arithmetic instrctions
 
Mastering Assembly Language: Programming with 8086
Mastering Assembly Language: Programming with 8086Mastering Assembly Language: Programming with 8086
Mastering Assembly Language: Programming with 8086
 
Instruction formats-in-8086
Instruction formats-in-8086Instruction formats-in-8086
Instruction formats-in-8086
 
Microprocessor Based Design and operations
Microprocessor Based Design and operationsMicroprocessor Based Design and operations
Microprocessor Based Design and operations
 

More from COMSATS Abbottabad

Kalman filter
Kalman filterKalman filter
Kalman filter
COMSATS Abbottabad
 
Enterpreneurship
EnterpreneurshipEnterpreneurship
Enterpreneurship
COMSATS Abbottabad
 
Sine wave inverter
Sine wave inverterSine wave inverter
Sine wave inverter
COMSATS Abbottabad
 
Light Tracking Solar Panel
Light Tracking Solar PanelLight Tracking Solar Panel
Light Tracking Solar Panel
COMSATS Abbottabad
 
Analysis of Electro-Mechanical System
Analysis of Electro-Mechanical SystemAnalysis of Electro-Mechanical System
Analysis of Electro-Mechanical System
COMSATS Abbottabad
 
coding and burning program in FPGA
coding and burning program in FPGAcoding and burning program in FPGA
coding and burning program in FPGA
COMSATS Abbottabad
 
8 bit full adder
8 bit full adder8 bit full adder
8 bit full adder
COMSATS Abbottabad
 
Fabrication process of Integrated Circuit (IC's)
Fabrication process of Integrated Circuit (IC's)Fabrication process of Integrated Circuit (IC's)
Fabrication process of Integrated Circuit (IC's)
COMSATS Abbottabad
 
Addition, subtraction and multiplication in assembly language
Addition, subtraction and multiplication in assembly languageAddition, subtraction and multiplication in assembly language
Addition, subtraction and multiplication in assembly language
COMSATS Abbottabad
 
Mathematical Modelling of Electro-Mechanical System in Matlab
Mathematical Modelling of Electro-Mechanical System in MatlabMathematical Modelling of Electro-Mechanical System in Matlab
Mathematical Modelling of Electro-Mechanical System in Matlab
COMSATS Abbottabad
 
Mathematical Modelling of Electrical/Mechanical modellinng in MATLAB
Mathematical Modelling of Electrical/Mechanical modellinng in MATLABMathematical Modelling of Electrical/Mechanical modellinng in MATLAB
Mathematical Modelling of Electrical/Mechanical modellinng in MATLAB
COMSATS Abbottabad
 
Introduction to MATLAB
Introduction to MATLAB Introduction to MATLAB
Introduction to MATLAB
COMSATS Abbottabad
 
Encoder + decoder
Encoder + decoderEncoder + decoder
Encoder + decoder
COMSATS Abbottabad
 
Principles of Communication
Principles of CommunicationPrinciples of Communication
Principles of Communication
COMSATS Abbottabad
 
Aurduino coding for transformer interfacing
Aurduino coding for transformer interfacingAurduino coding for transformer interfacing
Aurduino coding for transformer interfacing
COMSATS Abbottabad
 
Transformer Interfacing with Laptop
Transformer Interfacing with LaptopTransformer Interfacing with Laptop
Transformer Interfacing with Laptop
COMSATS Abbottabad
 
Temperature control Switch and Display By Led
Temperature control Switch and Display By LedTemperature control Switch and Display By Led
Temperature control Switch and Display By Led
COMSATS Abbottabad
 
stress and strain
stress and strainstress and strain
stress and strain
COMSATS Abbottabad
 
Generating PM wave
Generating PM wave Generating PM wave
Generating PM wave
COMSATS Abbottabad
 
Generating FM wave
Generating FM waveGenerating FM wave
Generating FM wave
COMSATS Abbottabad
 

More from COMSATS Abbottabad (20)

Kalman filter
Kalman filterKalman filter
Kalman filter
 
Enterpreneurship
EnterpreneurshipEnterpreneurship
Enterpreneurship
 
Sine wave inverter
Sine wave inverterSine wave inverter
Sine wave inverter
 
Light Tracking Solar Panel
Light Tracking Solar PanelLight Tracking Solar Panel
Light Tracking Solar Panel
 
Analysis of Electro-Mechanical System
Analysis of Electro-Mechanical SystemAnalysis of Electro-Mechanical System
Analysis of Electro-Mechanical System
 
coding and burning program in FPGA
coding and burning program in FPGAcoding and burning program in FPGA
coding and burning program in FPGA
 
8 bit full adder
8 bit full adder8 bit full adder
8 bit full adder
 
Fabrication process of Integrated Circuit (IC's)
Fabrication process of Integrated Circuit (IC's)Fabrication process of Integrated Circuit (IC's)
Fabrication process of Integrated Circuit (IC's)
 
Addition, subtraction and multiplication in assembly language
Addition, subtraction and multiplication in assembly languageAddition, subtraction and multiplication in assembly language
Addition, subtraction and multiplication in assembly language
 
Mathematical Modelling of Electro-Mechanical System in Matlab
Mathematical Modelling of Electro-Mechanical System in MatlabMathematical Modelling of Electro-Mechanical System in Matlab
Mathematical Modelling of Electro-Mechanical System in Matlab
 
Mathematical Modelling of Electrical/Mechanical modellinng in MATLAB
Mathematical Modelling of Electrical/Mechanical modellinng in MATLABMathematical Modelling of Electrical/Mechanical modellinng in MATLAB
Mathematical Modelling of Electrical/Mechanical modellinng in MATLAB
 
Introduction to MATLAB
Introduction to MATLAB Introduction to MATLAB
Introduction to MATLAB
 
Encoder + decoder
Encoder + decoderEncoder + decoder
Encoder + decoder
 
Principles of Communication
Principles of CommunicationPrinciples of Communication
Principles of Communication
 
Aurduino coding for transformer interfacing
Aurduino coding for transformer interfacingAurduino coding for transformer interfacing
Aurduino coding for transformer interfacing
 
Transformer Interfacing with Laptop
Transformer Interfacing with LaptopTransformer Interfacing with Laptop
Transformer Interfacing with Laptop
 
Temperature control Switch and Display By Led
Temperature control Switch and Display By LedTemperature control Switch and Display By Led
Temperature control Switch and Display By Led
 
stress and strain
stress and strainstress and strain
stress and strain
 
Generating PM wave
Generating PM wave Generating PM wave
Generating PM wave
 
Generating FM wave
Generating FM waveGenerating FM wave
Generating FM wave
 

Recently uploaded

spirit beverages ppt without graphics.pptx
spirit beverages ppt without graphics.pptxspirit beverages ppt without graphics.pptx
spirit beverages ppt without graphics.pptx
Madan Karki
 
ACRP 4-09 Risk Assessment Method to Support Modification of Airfield Separat...
ACRP 4-09 Risk Assessment Method to Support Modification of Airfield Separat...ACRP 4-09 Risk Assessment Method to Support Modification of Airfield Separat...
ACRP 4-09 Risk Assessment Method to Support Modification of Airfield Separat...
Mukeshwaran Balu
 
International Conference on NLP, Artificial Intelligence, Machine Learning an...
International Conference on NLP, Artificial Intelligence, Machine Learning an...International Conference on NLP, Artificial Intelligence, Machine Learning an...
International Conference on NLP, Artificial Intelligence, Machine Learning an...
gerogepatton
 
2. Operations Strategy in a Global Environment.ppt
2. Operations Strategy in a Global Environment.ppt2. Operations Strategy in a Global Environment.ppt
2. Operations Strategy in a Global Environment.ppt
PuktoonEngr
 
Understanding Inductive Bias in Machine Learning
Understanding Inductive Bias in Machine LearningUnderstanding Inductive Bias in Machine Learning
Understanding Inductive Bias in Machine Learning
SUTEJAS
 
Modelagem de um CSTR com reação endotermica.pdf
Modelagem de um CSTR com reação endotermica.pdfModelagem de um CSTR com reação endotermica.pdf
Modelagem de um CSTR com reação endotermica.pdf
camseq
 
Wearable antenna for antenna applications
Wearable antenna for antenna applicationsWearable antenna for antenna applications
Wearable antenna for antenna applications
Madhumitha Jayaram
 
Properties Railway Sleepers and Test.pptx
Properties Railway Sleepers and Test.pptxProperties Railway Sleepers and Test.pptx
Properties Railway Sleepers and Test.pptx
MDSABBIROJJAMANPAYEL
 
6th International Conference on Machine Learning & Applications (CMLA 2024)
6th International Conference on Machine Learning & Applications (CMLA 2024)6th International Conference on Machine Learning & Applications (CMLA 2024)
6th International Conference on Machine Learning & Applications (CMLA 2024)
ClaraZara1
 
Question paper of renewable energy sources
Question paper of renewable energy sourcesQuestion paper of renewable energy sources
Question paper of renewable energy sources
mahammadsalmanmech
 
22CYT12-Unit-V-E Waste and its Management.ppt
22CYT12-Unit-V-E Waste and its Management.ppt22CYT12-Unit-V-E Waste and its Management.ppt
22CYT12-Unit-V-E Waste and its Management.ppt
KrishnaveniKrishnara1
 
Embedded machine learning-based road conditions and driving behavior monitoring
Embedded machine learning-based road conditions and driving behavior monitoringEmbedded machine learning-based road conditions and driving behavior monitoring
Embedded machine learning-based road conditions and driving behavior monitoring
IJECEIAES
 
Manufacturing Process of molasses based distillery ppt.pptx
Manufacturing Process of molasses based distillery ppt.pptxManufacturing Process of molasses based distillery ppt.pptx
Manufacturing Process of molasses based distillery ppt.pptx
Madan Karki
 
A review on techniques and modelling methodologies used for checking electrom...
A review on techniques and modelling methodologies used for checking electrom...A review on techniques and modelling methodologies used for checking electrom...
A review on techniques and modelling methodologies used for checking electrom...
nooriasukmaningtyas
 
Advanced control scheme of doubly fed induction generator for wind turbine us...
Advanced control scheme of doubly fed induction generator for wind turbine us...Advanced control scheme of doubly fed induction generator for wind turbine us...
Advanced control scheme of doubly fed induction generator for wind turbine us...
IJECEIAES
 
basic-wireline-operations-course-mahmoud-f-radwan.pdf
basic-wireline-operations-course-mahmoud-f-radwan.pdfbasic-wireline-operations-course-mahmoud-f-radwan.pdf
basic-wireline-operations-course-mahmoud-f-radwan.pdf
NidhalKahouli2
 
Harnessing WebAssembly for Real-time Stateless Streaming Pipelines
Harnessing WebAssembly for Real-time Stateless Streaming PipelinesHarnessing WebAssembly for Real-time Stateless Streaming Pipelines
Harnessing WebAssembly for Real-time Stateless Streaming Pipelines
Christina Lin
 
BPV-GUI-01-Guide-for-ASME-Review-Teams-(General)-10-10-2023.pdf
BPV-GUI-01-Guide-for-ASME-Review-Teams-(General)-10-10-2023.pdfBPV-GUI-01-Guide-for-ASME-Review-Teams-(General)-10-10-2023.pdf
BPV-GUI-01-Guide-for-ASME-Review-Teams-(General)-10-10-2023.pdf
MIGUELANGEL966976
 
Recycled Concrete Aggregate in Construction Part III
Recycled Concrete Aggregate in Construction Part IIIRecycled Concrete Aggregate in Construction Part III
Recycled Concrete Aggregate in Construction Part III
Aditya Rajan Patra
 
IEEE Aerospace and Electronic Systems Society as a Graduate Student Member
IEEE Aerospace and Electronic Systems Society as a Graduate Student MemberIEEE Aerospace and Electronic Systems Society as a Graduate Student Member
IEEE Aerospace and Electronic Systems Society as a Graduate Student Member
VICTOR MAESTRE RAMIREZ
 

Recently uploaded (20)

spirit beverages ppt without graphics.pptx
spirit beverages ppt without graphics.pptxspirit beverages ppt without graphics.pptx
spirit beverages ppt without graphics.pptx
 
ACRP 4-09 Risk Assessment Method to Support Modification of Airfield Separat...
ACRP 4-09 Risk Assessment Method to Support Modification of Airfield Separat...ACRP 4-09 Risk Assessment Method to Support Modification of Airfield Separat...
ACRP 4-09 Risk Assessment Method to Support Modification of Airfield Separat...
 
International Conference on NLP, Artificial Intelligence, Machine Learning an...
International Conference on NLP, Artificial Intelligence, Machine Learning an...International Conference on NLP, Artificial Intelligence, Machine Learning an...
International Conference on NLP, Artificial Intelligence, Machine Learning an...
 
2. Operations Strategy in a Global Environment.ppt
2. Operations Strategy in a Global Environment.ppt2. Operations Strategy in a Global Environment.ppt
2. Operations Strategy in a Global Environment.ppt
 
Understanding Inductive Bias in Machine Learning
Understanding Inductive Bias in Machine LearningUnderstanding Inductive Bias in Machine Learning
Understanding Inductive Bias in Machine Learning
 
Modelagem de um CSTR com reação endotermica.pdf
Modelagem de um CSTR com reação endotermica.pdfModelagem de um CSTR com reação endotermica.pdf
Modelagem de um CSTR com reação endotermica.pdf
 
Wearable antenna for antenna applications
Wearable antenna for antenna applicationsWearable antenna for antenna applications
Wearable antenna for antenna applications
 
Properties Railway Sleepers and Test.pptx
Properties Railway Sleepers and Test.pptxProperties Railway Sleepers and Test.pptx
Properties Railway Sleepers and Test.pptx
 
6th International Conference on Machine Learning & Applications (CMLA 2024)
6th International Conference on Machine Learning & Applications (CMLA 2024)6th International Conference on Machine Learning & Applications (CMLA 2024)
6th International Conference on Machine Learning & Applications (CMLA 2024)
 
Question paper of renewable energy sources
Question paper of renewable energy sourcesQuestion paper of renewable energy sources
Question paper of renewable energy sources
 
22CYT12-Unit-V-E Waste and its Management.ppt
22CYT12-Unit-V-E Waste and its Management.ppt22CYT12-Unit-V-E Waste and its Management.ppt
22CYT12-Unit-V-E Waste and its Management.ppt
 
Embedded machine learning-based road conditions and driving behavior monitoring
Embedded machine learning-based road conditions and driving behavior monitoringEmbedded machine learning-based road conditions and driving behavior monitoring
Embedded machine learning-based road conditions and driving behavior monitoring
 
Manufacturing Process of molasses based distillery ppt.pptx
Manufacturing Process of molasses based distillery ppt.pptxManufacturing Process of molasses based distillery ppt.pptx
Manufacturing Process of molasses based distillery ppt.pptx
 
A review on techniques and modelling methodologies used for checking electrom...
A review on techniques and modelling methodologies used for checking electrom...A review on techniques and modelling methodologies used for checking electrom...
A review on techniques and modelling methodologies used for checking electrom...
 
Advanced control scheme of doubly fed induction generator for wind turbine us...
Advanced control scheme of doubly fed induction generator for wind turbine us...Advanced control scheme of doubly fed induction generator for wind turbine us...
Advanced control scheme of doubly fed induction generator for wind turbine us...
 
basic-wireline-operations-course-mahmoud-f-radwan.pdf
basic-wireline-operations-course-mahmoud-f-radwan.pdfbasic-wireline-operations-course-mahmoud-f-radwan.pdf
basic-wireline-operations-course-mahmoud-f-radwan.pdf
 
Harnessing WebAssembly for Real-time Stateless Streaming Pipelines
Harnessing WebAssembly for Real-time Stateless Streaming PipelinesHarnessing WebAssembly for Real-time Stateless Streaming Pipelines
Harnessing WebAssembly for Real-time Stateless Streaming Pipelines
 
BPV-GUI-01-Guide-for-ASME-Review-Teams-(General)-10-10-2023.pdf
BPV-GUI-01-Guide-for-ASME-Review-Teams-(General)-10-10-2023.pdfBPV-GUI-01-Guide-for-ASME-Review-Teams-(General)-10-10-2023.pdf
BPV-GUI-01-Guide-for-ASME-Review-Teams-(General)-10-10-2023.pdf
 
Recycled Concrete Aggregate in Construction Part III
Recycled Concrete Aggregate in Construction Part IIIRecycled Concrete Aggregate in Construction Part III
Recycled Concrete Aggregate in Construction Part III
 
IEEE Aerospace and Electronic Systems Society as a Graduate Student Member
IEEE Aerospace and Electronic Systems Society as a Graduate Student MemberIEEE Aerospace and Electronic Systems Society as a Graduate Student Member
IEEE Aerospace and Electronic Systems Society as a Graduate Student Member
 

IMPLEMENTING ARITHMETIC INSTRUCTIONS IN EMU 8086

  • 1. Lab Report 03 Group No 10 10/10/2017 1 | L a b 0 3 IMPLEMENTING ARITHMETIC INSTRUCTIONS IN EMU 8086 Objective: Learn how to:  Write programs in Emu8086 using arithmetic instructions  Write a complete assembly program.  Use Emu8086 to execute written programs  Use Emu8086 to execute single instruction at a time.  Edit an existing source program. Lab Outcomes: Practice 8086 Emulator Loading, verifying and saving machine code of arithmetic instructions. Executing arithmetic instructions and tracing programs. Arithmetic instructions: These instructions are used to perform various mathematical operations like addition, subtraction, multiplication and division etc. Addition instructions 1. ADD: Add specified byte to byte or word to word 2. ADC: Add with carry 3. INC: Increment specified byte or specified word by 1 4. AAA: ASCII adjust after addition 5. DAA : Decimal (BCD) adjust after addition Subtraction instructions 1. SUB : Subtract byte from byte or word from word 2. SBB : Subtract with borrow 3. DEC : Decrement specified byte or word by 1 4. NEG : Negate or invert each bit of a specified byte or word and add 1 (2’s complement) 5. CMP : Compare two specified byte or two specified words 6. AAS : ASCII adjust after subtraction 7. DAS : Decimal adjust after subtraction Multiplication instructions 1. MUL : Multiply unsigned byte by byte or unsigned word or word. 2. IMUL : Multiply signed bye by byte or signed word by word 3. AAM : ASCII adjust after multiplication Division instructions 1. DIV : Divide unsigned word by byte or unsigned double word by word 2. IDIV : Divide signed word by byte or signed double word by word 3. AAD : ASCII adjust after division 4. CBW : Fill upper byte of word with copies of sign bit of lower byte 5. CWD : Fill upper word of double word with sign bit of lower word.
  • 2. Lab Report 03 Group No 10 10/10/2017 2 | L a b 0 3 TASK No 1: Write an assembly language program for 8086 in which you will store two nonzero 8-bit numbers to AL and BL registers and perform the following operations 1. Add both values and store the answer in CH register. 2. Subtract the value placed in BL from AL and store the answer in CL. 3. Multiply the values and store it in AX register.(with and without using MUL instruction) 4. Divide the value at AL with BL and store the quotient in CH and remainder in DH register. Step No 01:
  • 3. Lab Report 03 Group No 10 10/10/2017 3 | L a b 0 3 Step No 2: Moving values to AL and BL registers. Step No 03: Adding values of AL and BL and storing into CH register.
  • 4. Lab Report 03 Group No 10 10/10/2017 4 | L a b 0 3 Step No 04: Moving back value of AL from DL. Step No 06: Subtracting values of AL and BL and storing it in CL register.
  • 5. Lab Report 03 Group No 10 10/10/2017 5 | L a b 0 3 Step No 07: Multiplying both values of AL and BL registers with MUL command. Step No 8: Multiplying both values of AL and BL registers without MUL command.
  • 6. Lab Report 03 Group No 10 10/10/2017 6 | L a b 0 3 Step No 09: Moving value of AL back from DL. Step No 10: Deviding values of AL and BL and storing quotient in CH and remainder in DH.
  • 7. Lab Report 03 Group No 10 10/10/2017 7 | L a b 0 3 Table No 01 Task No 2: Write an assembly language program for 8086 in which you will add two BCD numbers placed in AL and BL registers. Store the final answer in DL register. If the sum exceeds 8 bit value,store the high byte in DH register. The result must be in BCD. (Hint: Use JC and JNC instructions) Example 01: Without carry Step No 01: Coding Instructions AX BX CX DX CS IP SS SP BP SI DI DS ES AL AH BL BH CL CH DL DH MOV AL,09H 09 00 00 00 00 00 00 00 0100 0002 0100 FFFE 0000 0000 0000 0100 0100 MOV BL,02H 09 00 02 00 00 00 00 00 0100 0004 0100 FFFE 0000 0000 0000 0100 0100 MOV DL,AL 09 00 02 00 00 00 09 00 0100 0006 0100 FFFE 0000 0000 0000 0100 0100 ADD AL,BL 0B 00 02 00 00 00 09 00 0100 0008 0100 FFFE 0000 0000 0000 0100 0100 MOV CH,AL 0B 00 02 00 00 0B 09 00 0100 000A 0100 FFFE 0000 0000 0000 0100 0100 MOV AL,DL 09 00 02 00 00 0B 09 00 0100 000C 0100 FFFE 0000 0000 0000 0100 0100 SUB AL,BL 07 00 02 00 00 0B 09 00 0100 000E 0100 FFFE 0000 0000 0000 0100 0100 MOV CL,AL 07 00 02 00 07 0B 09 00 0100 0010 0100 FFFE 0000 0000 0000 0100 0100 MOV AL,DL 09 00 02 00 07 0B 09 00 0100 0012 0100 FFFE 0000 0000 0000 0100 0100 MUL BL 12 00 02 00 07 0B 09 00 0100 0014 0100 FFFE 0000 0000 0000 0100 0100 MOV AL,DL 09 00 02 00 07 0B 09 00 0100 0016 0100 FFFE 0000 0000 0000 0100 0100 MOV DH,BL 09 00 02 00 07 0B 09 02 0100 0018 0100 FFFE 0000 0000 0000 0100 0100 DEC DH 09 00 02 00 07 0B 09 01 0100 001A 0100 FFFE 0000 0000 0000 0100 0100 DEC DH 09 00 02 00 07 0B 09 00 0100 001E 0100 FFFE 0000 0000 0000 0100 0100 DIV BL 04 01 02 00 07 0B 09 00 0100 0020 0100 FFFE 0000 0000 0000 0100 0100 MOV CH,AL 04 01 02 00 07 04 09 00 0100 0022 0100 FFFE 0000 0000 0000 0100 0100 MOV DH,AH 04 01 02 00 07 04 09 01 0100 0024 0100 FFFE 0000 0000 0000 0100 0100
  • 8. Lab Report 03 Group No 10 10/10/2017 8 | L a b 0 3 Step No 02: Storing values in AL,BL registers. Step No 3: Adding values in AL and BL.
  • 9. Lab Report 03 Group No 10 10/10/2017 9 | L a b 0 3 Step No 04: Storing value of AL in DL register. Step No 05: Storing value of DX in AX and Adjusting BCD of the value stored in register AX.
  • 10. Lab Report 03 Group No 10 10/10/2017 10 | L a b 0 3 Example 2: With carry Step No 01: Coding
  • 11. Lab Report 03 Group No 10 10/10/2017 11 | L a b 0 3 Step No 02: Storing values in AL and BL registers. Step No 3:Adding values of AL and BL, storing in DL and carry in DH.
  • 12. Lab Report 03 Group No 10 10/10/2017 12 | L a b 0 3 Step No 04: Adjusting BCD using DAA command.
  • 13. Lab Report 03 Group No 10 10/10/2017 13 | L a b 0 3 Table No 02 Instructions AX BX CX DX CS IP SS SP BP SI DI DS ES AL AH BL BH CL CH DL DH MOV AL,0F0H F0 00 00 00 00 00 00 00 0100 0002 0100 FFFE 0000 0000 0000 0100 0100 MOV BL,014H F0 00 14 00 00 00 00 00 0100 0004 0100 FFFE 0000 0000 0000 0100 0100 ADD AL,BL 04 00 14 00 00 00 00 00 0100 0006 0100 FFFE 0000 0000 0000 0100 0100 INCDH 04 00 14 00 00 0B 00 01 0100 000A 0100 FFFE 0000 0000 0000 0100 0100 MOV DL,AL 04 00 14 00 00 0B 04 01 0100 000C 0100 FFFE 0000 0000 0000 0100 0100 MOV AX,DX 04 01 14 00 00 0B 04 01 0100 000E 0100 FFFE 0000 0000 0000 0100 0100 DAA 64 01 14 00 00 0B 04 01 0100 0010 0100 FFFE 0000 0000 0000 0100 0100