2
Most read
3
Most read
7
Most read
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

PDF
Instruction formats-in-8086
PPTX
INTEL 8086 MICROPROCESSOR
PPT
8086 microprocessor
PDF
8086 instruction set with types
PDF
Chap 8 The stack and introduction to procedures & Chapter 9 multiplication an...
PDF
Assembly Language Programming By Ytha Yu, Charles Marut Chap 7 (Logic, Shift,...
PPTX
Byte and string manipulation 8086
PPTX
Addressing modes of 8086
Instruction formats-in-8086
INTEL 8086 MICROPROCESSOR
8086 microprocessor
8086 instruction set with types
Chap 8 The stack and introduction to procedures & Chapter 9 multiplication an...
Assembly Language Programming By Ytha Yu, Charles Marut Chap 7 (Logic, Shift,...
Byte and string manipulation 8086
Addressing modes of 8086

What's hot (20)

PPTX
Verilog HDL
PPTX
Introduction to 8085 Microprocessor
PDF
8086 String Instructions.pdf
PPT
Assembly Language Lecture 1
PPTX
DAA AND DAS
DOCX
Instruction set of 8086
PDF
Assembly Language Programming By Ytha Yu, Charles Marut Chap 10 ( Arrays and ...
PDF
8086 microprocessor lab manual
PPTX
Arithmetic and logical instructions
PPT
8086-instruction-set-ppt
PPT
8086 micro processor
PPTX
Micro task1
PPTX
Instruction set of 8086
PDF
Processor Organization and Architecture
PPTX
Stack in microprocessor 8085(presantation)
PPTX
Addressing modes of 8086 - Binu Joy
PPT
Architecture of 8086 Microprocessor
PPTX
flag register of 8086
Verilog HDL
Introduction to 8085 Microprocessor
8086 String Instructions.pdf
Assembly Language Lecture 1
DAA AND DAS
Instruction set of 8086
Assembly Language Programming By Ytha Yu, Charles Marut Chap 10 ( Arrays and ...
8086 microprocessor lab manual
Arithmetic and logical instructions
8086-instruction-set-ppt
8086 micro processor
Micro task1
Instruction set of 8086
Processor Organization and Architecture
Stack in microprocessor 8085(presantation)
Addressing modes of 8086 - Binu Joy
Architecture of 8086 Microprocessor
flag register of 8086
Ad

Similar to IMPLEMENTING ARITHMETIC INSTRUCTIONS IN EMU 8086 (20)

PDF
8086 instructions
PPT
Unit 2 8086 Instruction set.ppt notes good
PPT
Cha_2b_8086-Instruction-set-ppt microprocessor
PPT
Instruction set of 8086
PDF
8086 instruction set
PDF
8086 instruction set
PDF
implementation of data instrucions in emu8086
PPTX
8086 Instruction set
PDF
8086 instruction set
PPT
8051assembly language
PPT
8085 instruction set and Programming
PDF
PDF
Exp 03
DOCX
computer organization and assembly language.docx
DOCX
Microprocessor
PPTX
Microprocessor and Microcontrollers LAB-PP.pptx
PDF
Microprocessor 8086-lab-mannual
PDF
Unit 2 assembly language programming
PDF
Assembly language 8086 intermediate
PDF
Assembly language 8086
8086 instructions
Unit 2 8086 Instruction set.ppt notes good
Cha_2b_8086-Instruction-set-ppt microprocessor
Instruction set of 8086
8086 instruction set
8086 instruction set
implementation of data instrucions in emu8086
8086 Instruction set
8086 instruction set
8051assembly language
8085 instruction set and Programming
Exp 03
computer organization and assembly language.docx
Microprocessor
Microprocessor and Microcontrollers LAB-PP.pptx
Microprocessor 8086-lab-mannual
Unit 2 assembly language programming
Assembly language 8086 intermediate
Assembly language 8086
Ad

More from COMSATS Abbottabad (20)

PDF
Kalman filter
PDF
Enterpreneurship
PPTX
Sine wave inverter
PPTX
Light Tracking Solar Panel
PDF
Analysis of Electro-Mechanical System
PDF
coding and burning program in FPGA
PDF
8 bit full adder
PDF
Fabrication process of Integrated Circuit (IC's)
PDF
Addition, subtraction and multiplication in assembly language
PDF
Mathematical Modelling of Electro-Mechanical System in Matlab
PDF
Mathematical Modelling of Electrical/Mechanical modellinng in MATLAB
PDF
Introduction to MATLAB
PDF
Encoder + decoder
PDF
Principles of Communication
PDF
Aurduino coding for transformer interfacing
PDF
Transformer Interfacing with Laptop
PDF
Temperature control Switch and Display By Led
PPTX
stress and strain
PDF
Generating PM wave
PDF
Generating FM wave
Kalman filter
Enterpreneurship
Sine wave inverter
Light Tracking Solar Panel
Analysis of Electro-Mechanical System
coding and burning program in FPGA
8 bit full adder
Fabrication process of Integrated Circuit (IC's)
Addition, subtraction and multiplication in assembly language
Mathematical Modelling of Electro-Mechanical System in Matlab
Mathematical Modelling of Electrical/Mechanical modellinng in MATLAB
Introduction to MATLAB
Encoder + decoder
Principles of Communication
Aurduino coding for transformer interfacing
Transformer Interfacing with Laptop
Temperature control Switch and Display By Led
stress and strain
Generating PM wave
Generating FM wave

Recently uploaded (20)

PDF
First part_B-Image Processing - 1 of 2).pdf
PDF
Applications of Equal_Area_Criterion.pdf
PPTX
Petroleum Refining & Petrochemicals.pptx
PDF
Exploratory_Data_Analysis_Fundamentals.pdf
PDF
20250617 - IR - Global Guide for HR - 51 pages.pdf
PPT
Chapter 1 - Introduction to Manufacturing Technology_2.ppt
PPTX
mechattonicsand iotwith sensor and actuator
PPTX
Micro1New.ppt.pptx the mai themes of micfrobiology
PPTX
CONTRACTS IN CONSTRUCTION PROJECTS: TYPES
PDF
LOW POWER CLASS AB SI POWER AMPLIFIER FOR WIRELESS MEDICAL SENSOR NETWORK
PPTX
Graph Data Structures with Types, Traversals, Connectivity, and Real-Life App...
PDF
UEFA_Embodied_Carbon_Emissions_Football_Infrastructure.pdf
PPTX
Amdahl’s law is explained in the above power point presentations
PDF
Cryptography and Network Security-Module-I.pdf
PDF
Computer organization and architecuture Digital Notes....pdf
PPTX
Principal presentation for NAAC (1).pptx
PDF
Java Basics-Introduction and program control
PPTX
wireless networks, mobile computing.pptx
PPTX
"Array and Linked List in Data Structures with Types, Operations, Implementat...
PPTX
PRASUNET_20240614003_231416_0000[1].pptx
First part_B-Image Processing - 1 of 2).pdf
Applications of Equal_Area_Criterion.pdf
Petroleum Refining & Petrochemicals.pptx
Exploratory_Data_Analysis_Fundamentals.pdf
20250617 - IR - Global Guide for HR - 51 pages.pdf
Chapter 1 - Introduction to Manufacturing Technology_2.ppt
mechattonicsand iotwith sensor and actuator
Micro1New.ppt.pptx the mai themes of micfrobiology
CONTRACTS IN CONSTRUCTION PROJECTS: TYPES
LOW POWER CLASS AB SI POWER AMPLIFIER FOR WIRELESS MEDICAL SENSOR NETWORK
Graph Data Structures with Types, Traversals, Connectivity, and Real-Life App...
UEFA_Embodied_Carbon_Emissions_Football_Infrastructure.pdf
Amdahl’s law is explained in the above power point presentations
Cryptography and Network Security-Module-I.pdf
Computer organization and architecuture Digital Notes....pdf
Principal presentation for NAAC (1).pptx
Java Basics-Introduction and program control
wireless networks, mobile computing.pptx
"Array and Linked List in Data Structures with Types, Operations, Implementat...
PRASUNET_20240614003_231416_0000[1].pptx

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