Professional Documents
Culture Documents
Algorithm:
If carry occurs (CF=1) increment the carry storing register and store the sum and
carry in the memory location. Otherwise store the sum in the memory location.
Flow chart:
Start
Clear CL Register
Perform Addition
[AX]=[AX]+[BX]
NO
Is
CF=1 ?
YES
Increment CL
Register
End
Observation:
INPUT OUTPUT
ADDRESS 1100 1101 1102 1103 1104 1105 1106 1107
DATA1
DATA2
Conclusion:
Thus the 16 bit numbers stored in memory location are added and the result stored in
another memory location using 8086p kits.
………………………………………………………………………………………………………………………………………..
Questions:
Algorithm:
If carry occurs (CF=1) increment the carry storing register and store the difference
and borrow in the memory location. Otherwise store the difference in the memory
location.
Flow chart:
Start
Clear CL Register
Perform Subtraction
[AX]=[AX]-[BX]
NO
Is
CF=1 ?
YES
Increment CL
Register
End
MACHINE T- EXECUTION
ADDRESS LABEL MNEMONICS OPERAND OPCODE BYTES COMMENTS
CYCLES STATES TIME
1000 START MOV CL,00H
1001
1002
MOV AX, [1100]
1003
1004
1005
1006 MOV BX, [1102]
1007
1008 SUB AX, BX
1009
100A JNC L1
100B
100C INC CL
100D
100E L1 MOV [1104], AX
100F
1010
1011 MOV [1106], CL
1012
1013 HLT
Observation:
INPUT OUTPUT
ADDRESS 1100 1101 1102 1103 1104 1105 1106 1107
DATA1
DATA2
Conclusion:
Thus the 16 bit numbers stored in memory location are subtracted and the result stored
in another memory location using 8086p kits.
………………………………………………………………………………………………………………………………………..
Questions:
Algorithm:
Flow chart:
Start
Clear CL register
Perform
Multiplication
[AX]=[AX]*[BX]]
[DX]=R[[DX][AX]/[BX]]
Store the results in
to memory
End
1009
100A MOV [1104], AX
100B
100C
100D MOV [1106], DX
100E
1010 HLT
Observation:
INPUT OUTPUT
ADDRESS 1100 1101 1102 1103 1104 1105 1106 1107
DATA1
DATA2
Conclusion:
Thus the 16 bit numbers stored in memory location are multiplied and the result stored in
another memory location using 8086p kits.
………………………………………………………………………………………………………………………………………..
Questions:
2. How will you perform multiplication without using the MUL instruction?
3. What are the various jump instructions available in 8086 instruction set?
Algorithm:
Divide the 32 bit data stored in the registers by the 16 bit data stored in the GP
register.
Flow chart:
Start
Perform Division
[AX]=Q[[DX][AX]/[BX]]
[DX]=R[[DX][AX]/[BX]]
End
100A
100B MOV [1106], AX
100C
100D
100E MOV [1108], DX
1010
1011 HLT
Observation:
INPUT OUTPUT
ADDRESS 1100 1101 1102 1103 1104 1105 1106 1107 1108 1109
DATA1
DATA2
Conclusion:
Thus the 16 bit numbers stored in memory location are divided and the result stored
in another memory location using 8086p kits.
……………………………………………………………………………………………………………………………………
…..
Questions:
Lab Exercises: