SlideShare a Scribd company logo
Lab Report 02
1 |G r o u p # 1 0
LAB 02
Implementing Data Instructions in Emu8086
Objective:
Learn
 How 8086 executes data instructions
.
Learn how to:
 Write programs in Emu8086 using data 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 data instructions.
 Executing data instructions and tracing programs.
1. Data Transfer Instructions: These instructions are used to transfer the data from source
operand to destination operand. All the store, move, load, exchange, input and output
instructions belong to this group.
General purpose byte or word transfer instructions:
(a) MOV : Copy byte or word from specified source to specified destination
(b) PUSH : Push the specified word to top of the stack
(c) POP : Pop the word from top of the stack to the specified location
(d) XCHG : Exchange the contents of the specified source and destination operands one
of which may be a register or memory location.
(e) PUSHA : Push all registers to the stack
(f) POPA : Pop the words from stack to all registers
Lab Report 02
2 |G r o u p # 1 0
Task 1: Write an assembly language program in which you will send three 16-bit
numbers to AX, BX and CX registers respectively. After that PUSH the values of the
registers to the stack. Furthermore, exchange the contents of AL with AH register, BL
with BH register and CL with CH register. Now, POP the values back to AX, BX and
CX registers. Check the final results in the registers and compare it with the previous
values.
Coding in emu8086:
MOV AX,07A2H
MOV BX,1A63H
MOV CX,08C3H
PUSH AX
PUSH BX
PUSH CX
XCHG AL,AH
XCHG BL,BH
XCHG CL,CH
POP AX
POP BX
POP CX
Lab Report 02
3 |G r o u p # 1 0
Running emu step by step:
1st
step: Storing 07A2 in AX register
Analysis:
Value is stored in AX register and address of IP also changed.
Lab Report 02
4 |G r o u p # 1 0
2nd
step: Storing 1A63 in BX register.
Analysis:
Value is stored in BX register and address of IP also changed.
Lab Report 02
5 |G r o u p # 1 0
3rd
step: Storing 08C3 in CX register.
Analysis:
Value is stored in CX register and address of IP also changed.
Lab Report 02
6 |G r o u p # 1 0
4th
step: Now pushing all the three registers to stack.
Analysis:
All the registers are pushed to stack but address of IP and SP is also changed for each
time when a register is pushed into stack.
Lab Report 02
7 |G r o u p # 1 0
5th
step: Exchanging the values of AL with AH.
Analysis:
Value of AL and AH are exchanged.
Lab Report 02
8 |G r o u p # 1 0
6th
step: Exchanging the values of BL with BH.
Analysis:
Values of BL and BH are exchanged.
Lab Report 02
9 |G r o u p # 1 0
7th
step: Exchanging the values of CL with CH.
Analysis:
Values of CL and CH are exchanged.
Lab Report 02
10 |G r o u p # 1 0
8th
step: Pop all values of registers from stack.
Analysis:
All values of registers are poped again from stack to registers. But values of AX and
CX are interchanged because stack works on last in first out (LIFO).
As after every command addresses of registers are changed respectively which are analysed
in table 1.
Lab Report 02
11 |G r o u p # 1 0
Table no 1
Task #2: Write an assembly language program in which you will send random values
to AX,BX,CX,DX,SI,DI,SP and BP. Push all the values to stack. After that clear all the
registers except SP. Now, Pop all the stack values to the above mentioned register again.
Check the final results and compare with the previous values.
Coding in emu8086:
MOV AX,283AH
MOV BX,83C2H
MOV CX,0928H
MOV DX,1234H
MOV SI,0001H
MOV DI,7300H
MOV SP,0100H
MOV BP,0199H
PUSHA
MOV AX,0000H
MOV BX,0000H
MOV CX,0000H
MOV DX,0000H
MOV SI,0000H
MOV DI,0000H
MOV BP,0000H
POPA
HLT
Instructions
AX BX CX DX CS IP SS SP BP SI DI DS ES
AL AH BL BH CL CH DL DH
MOV
AX,07A2H
A2 07 00 00 00 00 00 00 0100 0003 0100 FFFE 0000 0000 0000 0100 0100
MOV
BX,1A63H
A2 07 63 1A 00 00 00 00 0100 0006 0100 FFFE 0000 0000 0000 0100 0100
MOV
CX,08C3H
A2 07 63 1A C3 08 00 00 0100 0009 0100 FFFE 0000 0000 0000 0100 0100
PUSH AX A2 07 63 1A C3 08 00 00 0100 000A 0100 FFFC 0000 0000 0000 0100 0100
PUSH BX A2 07 63 1A C3 08 00 00 0100 000B 0100 FFFA 0000 0000 0000 0100 0100
PUSH CX A2 07 63 1A C3 08 00 00 0100 000C 0100 FFF8 0000 0000 0000 0100 0100
XCHG AL,AH 07 A2 63 1A C3 08 00 00 0100 000E 0100 FFF8 0000 0000 0000 0100 0100
XCHG BL,BH 07 A2 1A 63 C3 08 00 00 0100 0010 0100 FFF8 0000 0000 0000 0100 0100
XCHG CL,CH 07 A2 1A 63 08 C3 00 00 0100 0002 0100 FFF8 0000 0000 0000 0100 0100
POP AX C3 08 1A 63 C3 08 00 00 0100 0013 0100 FFFA 0000 0000 0000 0100 0100
POP BX C3 08 63 1A C3 08 00 00 0100 0014 0100 FFFC 0000 0000 0000 0100 0100
POP CX C3 08 63 1A A2 07 00 00 0100 0015 0100 FFFE 0000 0000 0000 0100 0100
Lab Report 02
12 |G r o u p # 1 0
Running emu step by step:
1st
step: Storing 283A in AX register.
Analysis: 283A is stored in AX.
Lab Report 02
13 |G r o u p # 1 0
2nd
Step : Storing 83C2 in BX.
Analysis: Value 83C2 is stored in BX.
3rd
step: Storing 0928 in CX
Analysis: Value 0928 is stored in CX.
Lab Report 02
14 |G r o u p # 1 0
4th
step: Storing 1234 in DX.
Analysis: 1234 is stored in DX but address of IP also changed.
5th
step: storing 0001 in SI.
Analysis: 0001 is stored in SI but address of IP also changed.
Lab Report 02
15 |G r o u p # 1 0
6th
step: Storing 7300 in DI.
Analysis: 7300 is stored in DI but address of IP also changed.
7th
step: Storing 0100 in SP register.
Analysis: 0100 is stored in SP but address of IP also changed.
Lab Report 02
16 |G r o u p # 1 0
8th
step: Storing 0199 in BP register.
Analysis: 0199 is stored in BP but address of IP also changed.
9th
step: Pushing all registers to stack register.
Analysis: All values of registers are pushed to stack but address of IP and SP also changed.
Lab Report 02
17 |G r o u p # 1 0
10th
step: Clearing all registers except SP by storing 0000 in it.
Analysis: All registers are cleared except SP.
11th
Step: Pop all values of registers from stack.
Analysis: All values of registers are pop to them again.
Lab Report 02
18 |G r o u p # 1 0
Table 2
Conclusion:
In this lab I had learnt to write programs in Emu8086 using data instructions,
complete assembly program, execute written programs and single instruction at a time.
Also I learnt to edit an existing source program.
I had practiced 8086 Emulator loading, verifying and saving machine code of data
instructions, executing data instructions and tracing programs.
Results are shown in table 1 and table 2.
Instructions
AX BX CX DX CS IP SS SP BP SI DI DS ES
AL AH BL BH CL CH DL DH
MOV
AX,283AH
3A 28 00 00 00 00 00 00 0100 0003 0100 FFFE 0000 0000 0000 0100 0100
MOV
BX,83C2H
3A 28 83 C2 00 00 00 00 0100 0006 0100 FFFE 0000 0000 0000 0100 0100
MOV
CX,0928H
3A 28 83 C2 09 28 00 00 0100 0009 0100 FFFE 0000 0000 0000 0100 0100
MOV
DX,1234H
3A 28 83 C2 09 28 12 34 0100 000C 0100 FFFE 0000 0000 0000 0100 0100
MOV
SI,0001H
3A 28 83 C2 09 28 12 34 0100 000F 0100 FFFE 0000 0001 0000 0100 0100
MOV
DI,7300H
3A 28 83 C2 09 28 12 34 0100 0012 0100 FFFE 0000 0001 7300 0100 0100
MOV
SP,0100H
3A 28 83 C2 09 28 12 34 0100 0015 0100 0100 0000 0001 7300 0100 0100
MOV
BP,0199H
3A 28 83 C2 09 28 12 34 0100 0018 0100 0100 0199 0001 7300 0100 0100
PUSHA 3A 28 83 C2 09 28 12 34 0100 0019 0100 00F0 0199 0001 7300 0100 0100
MOV
AX,0000H
00 00 83 C2 09 28 12 34 0100 001C 0100 00F0 0199 0001 7300 0100 0100
MOV
BX,0000H
00 00 00 00 09 28 12 34 0100 001F 0100 00F0 0199 0001 7300 0100 0100
MOV
CX,0000H
00 00 00 00 00 00 12 34 0100 0022 0100 00F0 0199 0001 7300 0100 0100
MOV
DX,0000H
00 00 00 00 00 00 00 00 0100 0025 0100 00F0 0199 0001 7300 0100 0100
MOV
SI,0000H
00 00 00 00 00 00 00 00 0100 0028 0100 00F0 0199 0000 7300 0100 0100
MOV
DI,0000H
00 00 00 00 00 00 00 00 0100 002B 0100 00F0 0199 0000 0000 0100 0100
MOV
BP,0000H
00 00 00 00 00 00 00 00 0100 002E 0100 00F0 0000 0000 0000 0100 0100
POPA 3A 28 83 C2 09 28 12 34 0100 002F 0100 0100 0199 0001 7300 0100 0100

More Related Content

What's hot

Lecture 28 , 29 & 30(instruction set & addressing mode of 8086.pptx
Lecture 28 , 29 & 30(instruction set & addressing mode of 8086.pptxLecture 28 , 29 & 30(instruction set & addressing mode of 8086.pptx
Lecture 28 , 29 & 30(instruction set & addressing mode of 8086.pptx
VikasMahor3
 
Instruction set of 8086
Instruction set of 8086Instruction set of 8086
Instruction set of 8086
Vijay Kumar
 
Assembly Language Lecture 2
Assembly Language Lecture 2Assembly Language Lecture 2
Assembly Language Lecture 2
Motaz Saad
 
8086 alp
8086 alp8086 alp
Microprocessor 8086
Microprocessor 8086Microprocessor 8086
Microprocessor 8086
Gopikrishna Madanan
 
Introduction to ibm pc assembly language
Introduction to ibm pc assembly languageIntroduction to ibm pc assembly language
Introduction to ibm pc assembly language
warda aziz
 
Time delay programs and assembler directives 8086
Time delay programs and assembler directives 8086Time delay programs and assembler directives 8086
Time delay programs and assembler directives 8086
Dheeraj Suri
 
Assignment on alp
Assignment on alpAssignment on alp
Assignment on alp
Jahurul Islam
 
Addressing modes
Addressing modesAddressing modes
Addressing modes
karthiga selvaraju
 
8086 assembly language
8086 assembly language8086 assembly language
8086 assembly language
Mir Majid
 
8086-instruction-set-ppt
 8086-instruction-set-ppt 8086-instruction-set-ppt
8086-instruction-set-ppt
jemimajerome
 
Assembly Language Basics
Assembly Language BasicsAssembly Language Basics
Assembly Language Basics
Education Front
 
IMPLEMENTING ARITHMETIC INSTRUCTIONS IN EMU 8086
IMPLEMENTING ARITHMETIC INSTRUCTIONS IN EMU 8086IMPLEMENTING ARITHMETIC INSTRUCTIONS IN EMU 8086
IMPLEMENTING ARITHMETIC INSTRUCTIONS IN EMU 8086
COMSATS Abbottabad
 
8086 new
8086 new8086 new
INTERRUPTS OF 8086 MICROPROCESSOR
INTERRUPTS OF 8086 MICROPROCESSORINTERRUPTS OF 8086 MICROPROCESSOR
INTERRUPTS OF 8086 MICROPROCESSOR
Gurudev joshi
 
Unit II arm 7 Instruction Set
Unit II arm 7 Instruction SetUnit II arm 7 Instruction Set
Unit II arm 7 Instruction Set
Dr. Pankaj Zope
 
Types of instructions
Types of instructionsTypes of instructions
Types of instructions
ihsanjamil
 
Representation of numbers and characters
Representation of numbers and charactersRepresentation of numbers and characters
Representation of numbers and characters
warda aziz
 
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
warda aziz
 
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
 

What's hot (20)

Lecture 28 , 29 & 30(instruction set & addressing mode of 8086.pptx
Lecture 28 , 29 & 30(instruction set & addressing mode of 8086.pptxLecture 28 , 29 & 30(instruction set & addressing mode of 8086.pptx
Lecture 28 , 29 & 30(instruction set & addressing mode of 8086.pptx
 
Instruction set of 8086
Instruction set of 8086Instruction set of 8086
Instruction set of 8086
 
Assembly Language Lecture 2
Assembly Language Lecture 2Assembly Language Lecture 2
Assembly Language Lecture 2
 
8086 alp
8086 alp8086 alp
8086 alp
 
Microprocessor 8086
Microprocessor 8086Microprocessor 8086
Microprocessor 8086
 
Introduction to ibm pc assembly language
Introduction to ibm pc assembly languageIntroduction to ibm pc assembly language
Introduction to ibm pc assembly language
 
Time delay programs and assembler directives 8086
Time delay programs and assembler directives 8086Time delay programs and assembler directives 8086
Time delay programs and assembler directives 8086
 
Assignment on alp
Assignment on alpAssignment on alp
Assignment on alp
 
Addressing modes
Addressing modesAddressing modes
Addressing modes
 
8086 assembly language
8086 assembly language8086 assembly language
8086 assembly language
 
8086-instruction-set-ppt
 8086-instruction-set-ppt 8086-instruction-set-ppt
8086-instruction-set-ppt
 
Assembly Language Basics
Assembly Language BasicsAssembly Language Basics
Assembly Language Basics
 
IMPLEMENTING ARITHMETIC INSTRUCTIONS IN EMU 8086
IMPLEMENTING ARITHMETIC INSTRUCTIONS IN EMU 8086IMPLEMENTING ARITHMETIC INSTRUCTIONS IN EMU 8086
IMPLEMENTING ARITHMETIC INSTRUCTIONS IN EMU 8086
 
8086 new
8086 new8086 new
8086 new
 
INTERRUPTS OF 8086 MICROPROCESSOR
INTERRUPTS OF 8086 MICROPROCESSORINTERRUPTS OF 8086 MICROPROCESSOR
INTERRUPTS OF 8086 MICROPROCESSOR
 
Unit II arm 7 Instruction Set
Unit II arm 7 Instruction SetUnit II arm 7 Instruction Set
Unit II arm 7 Instruction Set
 
Types of instructions
Types of instructionsTypes of instructions
Types of instructions
 
Representation of numbers and characters
Representation of numbers and charactersRepresentation of numbers and characters
Representation of numbers and characters
 
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
 
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 ...
 

Similar to implementation of data instrucions in emu8086

UNIT II.pptx
UNIT II.pptxUNIT II.pptx
UNIT II.pptx
ssuser47c811
 
8085 instruction set
8085 instruction set8085 instruction set
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
 
microp-8085 74 instructions for mct-A :P
microp-8085 74 instructions for mct-A :Pmicrop-8085 74 instructions for mct-A :P
microp-8085 74 instructions for mct-A :P
Jathin Kanumuri
 
microp-8085 74 instructions for mct-A :P-2
microp-8085 74 instructions for mct-A :P-2microp-8085 74 instructions for mct-A :P-2
microp-8085 74 instructions for mct-A :P-2
Jathin Kanumuri
 
Microprocessor architecture II
Microprocessor architecture   IIMicroprocessor architecture   II
Microprocessor architecture II
Dr.YNM
 
Instruction set 8085
Instruction set 8085Instruction set 8085
Instruction set 8085
varun sukheja
 
Microcontroller 8051- soft.ppt
Microcontroller 8051- soft.pptMicrocontroller 8051- soft.ppt
Microcontroller 8051- soft.ppt
steffydean
 
Real Time Embedded System
Real Time Embedded SystemReal Time Embedded System
Real Time Embedded System
Vrushali Lanjewar
 
Instructionsetof8086 180224060745(3)
Instructionsetof8086 180224060745(3)Instructionsetof8086 180224060745(3)
Instructionsetof8086 180224060745(3)
AmitPaliwal20
 
Micro task1
Micro task1Micro task1
Micro task1
ChetanShahukari
 
instruction-set-of-8086-mr-binu-joy3.ppt
instruction-set-of-8086-mr-binu-joy3.pptinstruction-set-of-8086-mr-binu-joy3.ppt
instruction-set-of-8086-mr-binu-joy3.ppt
ssuser2b759d
 
Micro controller(pratheesh)
Micro controller(pratheesh)Micro controller(pratheesh)
Micro controller(pratheesh)
Pratheesh Pala
 
Introduction to 8085 by adi ppt
Introduction to 8085 by adi pptIntroduction to 8085 by adi ppt
Introduction to 8085 by adi ppt
Prof. Dr. K. Adisesha
 
Assemblylanguageprogrammingof8085 100523023329-phpapp02
Assemblylanguageprogrammingof8085 100523023329-phpapp02Assemblylanguageprogrammingof8085 100523023329-phpapp02
Assemblylanguageprogrammingof8085 100523023329-phpapp02
Swati Watve-Phadke
 
lec15_x86procedure_4up.pdf
lec15_x86procedure_4up.pdflec15_x86procedure_4up.pdf
lec15_x86procedure_4up.pdf
hasan58964
 
8085 instruction set
8085 instruction set8085 instruction set
8085 instruction set
JLoknathDora
 
Lecture6
Lecture6Lecture6
1344 Alp Of 8086
1344 Alp Of 80861344 Alp Of 8086
1344 Alp Of 8086
techbed
 

Similar to implementation of data instrucions in emu8086 (20)

UNIT II.pptx
UNIT II.pptxUNIT II.pptx
UNIT II.pptx
 
8085 instruction set
8085 instruction set8085 instruction set
8085 instruction set
 
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
 
microp-8085 74 instructions for mct-A :P
microp-8085 74 instructions for mct-A :Pmicrop-8085 74 instructions for mct-A :P
microp-8085 74 instructions for mct-A :P
 
microp-8085 74 instructions for mct-A :P-2
microp-8085 74 instructions for mct-A :P-2microp-8085 74 instructions for mct-A :P-2
microp-8085 74 instructions for mct-A :P-2
 
Microprocessor architecture II
Microprocessor architecture   IIMicroprocessor architecture   II
Microprocessor architecture II
 
Instruction set 8085
Instruction set 8085Instruction set 8085
Instruction set 8085
 
Microcontroller 8051- soft.ppt
Microcontroller 8051- soft.pptMicrocontroller 8051- soft.ppt
Microcontroller 8051- soft.ppt
 
Real Time Embedded System
Real Time Embedded SystemReal Time Embedded System
Real Time Embedded System
 
Instructionsetof8086 180224060745(3)
Instructionsetof8086 180224060745(3)Instructionsetof8086 180224060745(3)
Instructionsetof8086 180224060745(3)
 
Micro task1
Micro task1Micro task1
Micro task1
 
instruction-set-of-8086-mr-binu-joy3.ppt
instruction-set-of-8086-mr-binu-joy3.pptinstruction-set-of-8086-mr-binu-joy3.ppt
instruction-set-of-8086-mr-binu-joy3.ppt
 
Micro controller(pratheesh)
Micro controller(pratheesh)Micro controller(pratheesh)
Micro controller(pratheesh)
 
Introduction to 8085 by adi ppt
Introduction to 8085 by adi pptIntroduction to 8085 by adi ppt
Introduction to 8085 by adi ppt
 
Assemblylanguageprogrammingof8085 100523023329-phpapp02
Assemblylanguageprogrammingof8085 100523023329-phpapp02Assemblylanguageprogrammingof8085 100523023329-phpapp02
Assemblylanguageprogrammingof8085 100523023329-phpapp02
 
lec15_x86procedure_4up.pdf
lec15_x86procedure_4up.pdflec15_x86procedure_4up.pdf
lec15_x86procedure_4up.pdf
 
8085 instruction set
8085 instruction set8085 instruction set
8085 instruction set
 
Lecture6
Lecture6Lecture6
Lecture6
 
1344 Alp Of 8086
1344 Alp Of 80861344 Alp Of 8086
1344 Alp Of 8086
 

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

Group Presentation 2 Economics.Ariana Buscigliopptx
Group Presentation 2 Economics.Ariana BuscigliopptxGroup Presentation 2 Economics.Ariana Buscigliopptx
Group Presentation 2 Economics.Ariana Buscigliopptx
ArianaBusciglio
 
S1-Introduction-Biopesticides in ICM.pptx
S1-Introduction-Biopesticides in ICM.pptxS1-Introduction-Biopesticides in ICM.pptx
S1-Introduction-Biopesticides in ICM.pptx
tarandeep35
 
Thesis Statement for students diagnonsed withADHD.ppt
Thesis Statement for students diagnonsed withADHD.pptThesis Statement for students diagnonsed withADHD.ppt
Thesis Statement for students diagnonsed withADHD.ppt
EverAndrsGuerraGuerr
 
Liberal Approach to the Study of Indian Politics.pdf
Liberal Approach to the Study of Indian Politics.pdfLiberal Approach to the Study of Indian Politics.pdf
Liberal Approach to the Study of Indian Politics.pdf
WaniBasim
 
Pride Month Slides 2024 David Douglas School District
Pride Month Slides 2024 David Douglas School DistrictPride Month Slides 2024 David Douglas School District
Pride Month Slides 2024 David Douglas School District
David Douglas School District
 
Advanced Java[Extra Concepts, Not Difficult].docx
Advanced Java[Extra Concepts, Not Difficult].docxAdvanced Java[Extra Concepts, Not Difficult].docx
Advanced Java[Extra Concepts, Not Difficult].docx
adhitya5119
 
Advantages and Disadvantages of CMS from an SEO Perspective
Advantages and Disadvantages of CMS from an SEO PerspectiveAdvantages and Disadvantages of CMS from an SEO Perspective
Advantages and Disadvantages of CMS from an SEO Perspective
Krisztián Száraz
 
CACJapan - GROUP Presentation 1- Wk 4.pdf
CACJapan - GROUP Presentation 1- Wk 4.pdfCACJapan - GROUP Presentation 1- Wk 4.pdf
CACJapan - GROUP Presentation 1- Wk 4.pdf
camakaiclarkmusic
 
ANATOMY AND BIOMECHANICS OF HIP JOINT.pdf
ANATOMY AND BIOMECHANICS OF HIP JOINT.pdfANATOMY AND BIOMECHANICS OF HIP JOINT.pdf
ANATOMY AND BIOMECHANICS OF HIP JOINT.pdf
Priyankaranawat4
 
Assignment_4_ArianaBusciglio Marvel(1).docx
Assignment_4_ArianaBusciglio Marvel(1).docxAssignment_4_ArianaBusciglio Marvel(1).docx
Assignment_4_ArianaBusciglio Marvel(1).docx
ArianaBusciglio
 
What is the purpose of studying mathematics.pptx
What is the purpose of studying mathematics.pptxWhat is the purpose of studying mathematics.pptx
What is the purpose of studying mathematics.pptx
christianmathematics
 
Chapter 4 - Islamic Financial Institutions in Malaysia.pptx
Chapter 4 - Islamic Financial Institutions in Malaysia.pptxChapter 4 - Islamic Financial Institutions in Malaysia.pptx
Chapter 4 - Islamic Financial Institutions in Malaysia.pptx
Mohd Adib Abd Muin, Senior Lecturer at Universiti Utara Malaysia
 
Biological Screening of Herbal Drugs in detailed.
Biological Screening of Herbal Drugs in detailed.Biological Screening of Herbal Drugs in detailed.
Biological Screening of Herbal Drugs in detailed.
Ashokrao Mane college of Pharmacy Peth-Vadgaon
 
Lapbook sobre os Regimes Totalitários.pdf
Lapbook sobre os Regimes Totalitários.pdfLapbook sobre os Regimes Totalitários.pdf
Lapbook sobre os Regimes Totalitários.pdf
Jean Carlos Nunes Paixão
 
The basics of sentences session 5pptx.pptx
The basics of sentences session 5pptx.pptxThe basics of sentences session 5pptx.pptx
The basics of sentences session 5pptx.pptx
heathfieldcps1
 
Top five deadliest dog breeds in America
Top five deadliest dog breeds in AmericaTop five deadliest dog breeds in America
Top five deadliest dog breeds in America
Bisnar Chase Personal Injury Attorneys
 
MATATAG CURRICULUM: ASSESSING THE READINESS OF ELEM. PUBLIC SCHOOL TEACHERS I...
MATATAG CURRICULUM: ASSESSING THE READINESS OF ELEM. PUBLIC SCHOOL TEACHERS I...MATATAG CURRICULUM: ASSESSING THE READINESS OF ELEM. PUBLIC SCHOOL TEACHERS I...
MATATAG CURRICULUM: ASSESSING THE READINESS OF ELEM. PUBLIC SCHOOL TEACHERS I...
NelTorrente
 
A Strategic Approach: GenAI in Education
A Strategic Approach: GenAI in EducationA Strategic Approach: GenAI in Education
A Strategic Approach: GenAI in Education
Peter Windle
 
How to Fix the Import Error in the Odoo 17
How to Fix the Import Error in the Odoo 17How to Fix the Import Error in the Odoo 17
How to Fix the Import Error in the Odoo 17
Celine George
 
Executive Directors Chat Leveraging AI for Diversity, Equity, and Inclusion
Executive Directors Chat  Leveraging AI for Diversity, Equity, and InclusionExecutive Directors Chat  Leveraging AI for Diversity, Equity, and Inclusion
Executive Directors Chat Leveraging AI for Diversity, Equity, and Inclusion
TechSoup
 

Recently uploaded (20)

Group Presentation 2 Economics.Ariana Buscigliopptx
Group Presentation 2 Economics.Ariana BuscigliopptxGroup Presentation 2 Economics.Ariana Buscigliopptx
Group Presentation 2 Economics.Ariana Buscigliopptx
 
S1-Introduction-Biopesticides in ICM.pptx
S1-Introduction-Biopesticides in ICM.pptxS1-Introduction-Biopesticides in ICM.pptx
S1-Introduction-Biopesticides in ICM.pptx
 
Thesis Statement for students diagnonsed withADHD.ppt
Thesis Statement for students diagnonsed withADHD.pptThesis Statement for students diagnonsed withADHD.ppt
Thesis Statement for students diagnonsed withADHD.ppt
 
Liberal Approach to the Study of Indian Politics.pdf
Liberal Approach to the Study of Indian Politics.pdfLiberal Approach to the Study of Indian Politics.pdf
Liberal Approach to the Study of Indian Politics.pdf
 
Pride Month Slides 2024 David Douglas School District
Pride Month Slides 2024 David Douglas School DistrictPride Month Slides 2024 David Douglas School District
Pride Month Slides 2024 David Douglas School District
 
Advanced Java[Extra Concepts, Not Difficult].docx
Advanced Java[Extra Concepts, Not Difficult].docxAdvanced Java[Extra Concepts, Not Difficult].docx
Advanced Java[Extra Concepts, Not Difficult].docx
 
Advantages and Disadvantages of CMS from an SEO Perspective
Advantages and Disadvantages of CMS from an SEO PerspectiveAdvantages and Disadvantages of CMS from an SEO Perspective
Advantages and Disadvantages of CMS from an SEO Perspective
 
CACJapan - GROUP Presentation 1- Wk 4.pdf
CACJapan - GROUP Presentation 1- Wk 4.pdfCACJapan - GROUP Presentation 1- Wk 4.pdf
CACJapan - GROUP Presentation 1- Wk 4.pdf
 
ANATOMY AND BIOMECHANICS OF HIP JOINT.pdf
ANATOMY AND BIOMECHANICS OF HIP JOINT.pdfANATOMY AND BIOMECHANICS OF HIP JOINT.pdf
ANATOMY AND BIOMECHANICS OF HIP JOINT.pdf
 
Assignment_4_ArianaBusciglio Marvel(1).docx
Assignment_4_ArianaBusciglio Marvel(1).docxAssignment_4_ArianaBusciglio Marvel(1).docx
Assignment_4_ArianaBusciglio Marvel(1).docx
 
What is the purpose of studying mathematics.pptx
What is the purpose of studying mathematics.pptxWhat is the purpose of studying mathematics.pptx
What is the purpose of studying mathematics.pptx
 
Chapter 4 - Islamic Financial Institutions in Malaysia.pptx
Chapter 4 - Islamic Financial Institutions in Malaysia.pptxChapter 4 - Islamic Financial Institutions in Malaysia.pptx
Chapter 4 - Islamic Financial Institutions in Malaysia.pptx
 
Biological Screening of Herbal Drugs in detailed.
Biological Screening of Herbal Drugs in detailed.Biological Screening of Herbal Drugs in detailed.
Biological Screening of Herbal Drugs in detailed.
 
Lapbook sobre os Regimes Totalitários.pdf
Lapbook sobre os Regimes Totalitários.pdfLapbook sobre os Regimes Totalitários.pdf
Lapbook sobre os Regimes Totalitários.pdf
 
The basics of sentences session 5pptx.pptx
The basics of sentences session 5pptx.pptxThe basics of sentences session 5pptx.pptx
The basics of sentences session 5pptx.pptx
 
Top five deadliest dog breeds in America
Top five deadliest dog breeds in AmericaTop five deadliest dog breeds in America
Top five deadliest dog breeds in America
 
MATATAG CURRICULUM: ASSESSING THE READINESS OF ELEM. PUBLIC SCHOOL TEACHERS I...
MATATAG CURRICULUM: ASSESSING THE READINESS OF ELEM. PUBLIC SCHOOL TEACHERS I...MATATAG CURRICULUM: ASSESSING THE READINESS OF ELEM. PUBLIC SCHOOL TEACHERS I...
MATATAG CURRICULUM: ASSESSING THE READINESS OF ELEM. PUBLIC SCHOOL TEACHERS I...
 
A Strategic Approach: GenAI in Education
A Strategic Approach: GenAI in EducationA Strategic Approach: GenAI in Education
A Strategic Approach: GenAI in Education
 
How to Fix the Import Error in the Odoo 17
How to Fix the Import Error in the Odoo 17How to Fix the Import Error in the Odoo 17
How to Fix the Import Error in the Odoo 17
 
Executive Directors Chat Leveraging AI for Diversity, Equity, and Inclusion
Executive Directors Chat  Leveraging AI for Diversity, Equity, and InclusionExecutive Directors Chat  Leveraging AI for Diversity, Equity, and Inclusion
Executive Directors Chat Leveraging AI for Diversity, Equity, and Inclusion
 

implementation of data instrucions in emu8086

  • 1. Lab Report 02 1 |G r o u p # 1 0 LAB 02 Implementing Data Instructions in Emu8086 Objective: Learn  How 8086 executes data instructions . Learn how to:  Write programs in Emu8086 using data 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 data instructions.  Executing data instructions and tracing programs. 1. Data Transfer Instructions: These instructions are used to transfer the data from source operand to destination operand. All the store, move, load, exchange, input and output instructions belong to this group. General purpose byte or word transfer instructions: (a) MOV : Copy byte or word from specified source to specified destination (b) PUSH : Push the specified word to top of the stack (c) POP : Pop the word from top of the stack to the specified location (d) XCHG : Exchange the contents of the specified source and destination operands one of which may be a register or memory location. (e) PUSHA : Push all registers to the stack (f) POPA : Pop the words from stack to all registers
  • 2. Lab Report 02 2 |G r o u p # 1 0 Task 1: Write an assembly language program in which you will send three 16-bit numbers to AX, BX and CX registers respectively. After that PUSH the values of the registers to the stack. Furthermore, exchange the contents of AL with AH register, BL with BH register and CL with CH register. Now, POP the values back to AX, BX and CX registers. Check the final results in the registers and compare it with the previous values. Coding in emu8086: MOV AX,07A2H MOV BX,1A63H MOV CX,08C3H PUSH AX PUSH BX PUSH CX XCHG AL,AH XCHG BL,BH XCHG CL,CH POP AX POP BX POP CX
  • 3. Lab Report 02 3 |G r o u p # 1 0 Running emu step by step: 1st step: Storing 07A2 in AX register Analysis: Value is stored in AX register and address of IP also changed.
  • 4. Lab Report 02 4 |G r o u p # 1 0 2nd step: Storing 1A63 in BX register. Analysis: Value is stored in BX register and address of IP also changed.
  • 5. Lab Report 02 5 |G r o u p # 1 0 3rd step: Storing 08C3 in CX register. Analysis: Value is stored in CX register and address of IP also changed.
  • 6. Lab Report 02 6 |G r o u p # 1 0 4th step: Now pushing all the three registers to stack. Analysis: All the registers are pushed to stack but address of IP and SP is also changed for each time when a register is pushed into stack.
  • 7. Lab Report 02 7 |G r o u p # 1 0 5th step: Exchanging the values of AL with AH. Analysis: Value of AL and AH are exchanged.
  • 8. Lab Report 02 8 |G r o u p # 1 0 6th step: Exchanging the values of BL with BH. Analysis: Values of BL and BH are exchanged.
  • 9. Lab Report 02 9 |G r o u p # 1 0 7th step: Exchanging the values of CL with CH. Analysis: Values of CL and CH are exchanged.
  • 10. Lab Report 02 10 |G r o u p # 1 0 8th step: Pop all values of registers from stack. Analysis: All values of registers are poped again from stack to registers. But values of AX and CX are interchanged because stack works on last in first out (LIFO). As after every command addresses of registers are changed respectively which are analysed in table 1.
  • 11. Lab Report 02 11 |G r o u p # 1 0 Table no 1 Task #2: Write an assembly language program in which you will send random values to AX,BX,CX,DX,SI,DI,SP and BP. Push all the values to stack. After that clear all the registers except SP. Now, Pop all the stack values to the above mentioned register again. Check the final results and compare with the previous values. Coding in emu8086: MOV AX,283AH MOV BX,83C2H MOV CX,0928H MOV DX,1234H MOV SI,0001H MOV DI,7300H MOV SP,0100H MOV BP,0199H PUSHA MOV AX,0000H MOV BX,0000H MOV CX,0000H MOV DX,0000H MOV SI,0000H MOV DI,0000H MOV BP,0000H POPA HLT Instructions AX BX CX DX CS IP SS SP BP SI DI DS ES AL AH BL BH CL CH DL DH MOV AX,07A2H A2 07 00 00 00 00 00 00 0100 0003 0100 FFFE 0000 0000 0000 0100 0100 MOV BX,1A63H A2 07 63 1A 00 00 00 00 0100 0006 0100 FFFE 0000 0000 0000 0100 0100 MOV CX,08C3H A2 07 63 1A C3 08 00 00 0100 0009 0100 FFFE 0000 0000 0000 0100 0100 PUSH AX A2 07 63 1A C3 08 00 00 0100 000A 0100 FFFC 0000 0000 0000 0100 0100 PUSH BX A2 07 63 1A C3 08 00 00 0100 000B 0100 FFFA 0000 0000 0000 0100 0100 PUSH CX A2 07 63 1A C3 08 00 00 0100 000C 0100 FFF8 0000 0000 0000 0100 0100 XCHG AL,AH 07 A2 63 1A C3 08 00 00 0100 000E 0100 FFF8 0000 0000 0000 0100 0100 XCHG BL,BH 07 A2 1A 63 C3 08 00 00 0100 0010 0100 FFF8 0000 0000 0000 0100 0100 XCHG CL,CH 07 A2 1A 63 08 C3 00 00 0100 0002 0100 FFF8 0000 0000 0000 0100 0100 POP AX C3 08 1A 63 C3 08 00 00 0100 0013 0100 FFFA 0000 0000 0000 0100 0100 POP BX C3 08 63 1A C3 08 00 00 0100 0014 0100 FFFC 0000 0000 0000 0100 0100 POP CX C3 08 63 1A A2 07 00 00 0100 0015 0100 FFFE 0000 0000 0000 0100 0100
  • 12. Lab Report 02 12 |G r o u p # 1 0 Running emu step by step: 1st step: Storing 283A in AX register. Analysis: 283A is stored in AX.
  • 13. Lab Report 02 13 |G r o u p # 1 0 2nd Step : Storing 83C2 in BX. Analysis: Value 83C2 is stored in BX. 3rd step: Storing 0928 in CX Analysis: Value 0928 is stored in CX.
  • 14. Lab Report 02 14 |G r o u p # 1 0 4th step: Storing 1234 in DX. Analysis: 1234 is stored in DX but address of IP also changed. 5th step: storing 0001 in SI. Analysis: 0001 is stored in SI but address of IP also changed.
  • 15. Lab Report 02 15 |G r o u p # 1 0 6th step: Storing 7300 in DI. Analysis: 7300 is stored in DI but address of IP also changed. 7th step: Storing 0100 in SP register. Analysis: 0100 is stored in SP but address of IP also changed.
  • 16. Lab Report 02 16 |G r o u p # 1 0 8th step: Storing 0199 in BP register. Analysis: 0199 is stored in BP but address of IP also changed. 9th step: Pushing all registers to stack register. Analysis: All values of registers are pushed to stack but address of IP and SP also changed.
  • 17. Lab Report 02 17 |G r o u p # 1 0 10th step: Clearing all registers except SP by storing 0000 in it. Analysis: All registers are cleared except SP. 11th Step: Pop all values of registers from stack. Analysis: All values of registers are pop to them again.
  • 18. Lab Report 02 18 |G r o u p # 1 0 Table 2 Conclusion: In this lab I had learnt to write programs in Emu8086 using data instructions, complete assembly program, execute written programs and single instruction at a time. Also I learnt to edit an existing source program. I had practiced 8086 Emulator loading, verifying and saving machine code of data instructions, executing data instructions and tracing programs. Results are shown in table 1 and table 2. Instructions AX BX CX DX CS IP SS SP BP SI DI DS ES AL AH BL BH CL CH DL DH MOV AX,283AH 3A 28 00 00 00 00 00 00 0100 0003 0100 FFFE 0000 0000 0000 0100 0100 MOV BX,83C2H 3A 28 83 C2 00 00 00 00 0100 0006 0100 FFFE 0000 0000 0000 0100 0100 MOV CX,0928H 3A 28 83 C2 09 28 00 00 0100 0009 0100 FFFE 0000 0000 0000 0100 0100 MOV DX,1234H 3A 28 83 C2 09 28 12 34 0100 000C 0100 FFFE 0000 0000 0000 0100 0100 MOV SI,0001H 3A 28 83 C2 09 28 12 34 0100 000F 0100 FFFE 0000 0001 0000 0100 0100 MOV DI,7300H 3A 28 83 C2 09 28 12 34 0100 0012 0100 FFFE 0000 0001 7300 0100 0100 MOV SP,0100H 3A 28 83 C2 09 28 12 34 0100 0015 0100 0100 0000 0001 7300 0100 0100 MOV BP,0199H 3A 28 83 C2 09 28 12 34 0100 0018 0100 0100 0199 0001 7300 0100 0100 PUSHA 3A 28 83 C2 09 28 12 34 0100 0019 0100 00F0 0199 0001 7300 0100 0100 MOV AX,0000H 00 00 83 C2 09 28 12 34 0100 001C 0100 00F0 0199 0001 7300 0100 0100 MOV BX,0000H 00 00 00 00 09 28 12 34 0100 001F 0100 00F0 0199 0001 7300 0100 0100 MOV CX,0000H 00 00 00 00 00 00 12 34 0100 0022 0100 00F0 0199 0001 7300 0100 0100 MOV DX,0000H 00 00 00 00 00 00 00 00 0100 0025 0100 00F0 0199 0001 7300 0100 0100 MOV SI,0000H 00 00 00 00 00 00 00 00 0100 0028 0100 00F0 0199 0000 7300 0100 0100 MOV DI,0000H 00 00 00 00 00 00 00 00 0100 002B 0100 00F0 0199 0000 0000 0100 0100 MOV BP,0000H 00 00 00 00 00 00 00 00 0100 002E 0100 00F0 0000 0000 0000 0100 0100 POPA 3A 28 83 C2 09 28 12 34 0100 002F 0100 0100 0199 0001 7300 0100 0100