To write and execute Assembly Language Programs to perform arithmetic operations for the 8086 microprocessor.
- Personal Computer with MASM Software
- Initialize memory location in HL register.
- Store 1st data.
- Increment HL to enter 2nd data.
- Move 2nd number to accumulator.
- Decrement HL.
- Add value in memory with accumulator.
- Store result.
- Stop.
CODE SEGMENT
ASSUME CS: CODE, DS: CODE
ORG 1000H
MOV SI,2000H
MOV CL,00H
MOV AX,[SI]
MOV BX,[SI+02H]
ADD AX,BX
JNC L1
INC CL
L1:
MOV [SI+04H],AX
MOV [SI+06H],CL
MOV AH,4CH
INT 21H
CODE ENDS
END| MEMORY LOCATION (INPUT) | MEMORY LOCATION (OUTPUT) |
|---|---|
| 1200:12 | 1204:24 |
| 1201:34 | 1205:68 |
| 1202:12 | 1206:00 |
| 1203:34 | 1207:C4 |
- Initialize memory and store 1st data.
- Increment to get 2nd data.
- Move 2nd data to accumulator.
- Subtract memory content.
- Store result.
CODE SEGMENT
ASSUME CS: CODE, DS: CODE
ORG 1000H
MOV SI,2000H
MOV CL,00H
MOV AX,[SI]
MOV BX,[SI+02H]
SUB AX,BX
JNC L1
INC CL
L1:
MOV [SI+04H],AX
MOV [SI+06H],CL
MOV AH,4CH
INT 21H
CODE ENDS
END| MEMORY LOCATION (INPUT) | MEMORY LOCATION (OUTPUT) |
|---|---|
| 1200:12 | 1204:00 |
| 1201:34 | 1205:00 |
| 1202:12 | 1206:00 |
| 1203:34 | 1207:C4 |
(Add your calculation here)
- Initialize memory and store operands.
- Move operands to registers.
- Multiply.
- Store result.
##FLOWCHART
CODE SEGMENT
ASSUME CS: CODE, DS: CODE
ORG 1000H
MOV SI,2000H
MOV DX,0000H
MOV AX,[SI]
MOV BX,[SI+02H]
MUL BX
MOV [SI+04H],AX
MOV [SI+06H],DX
MOV AH,4CH
INT 21H
CODE ENDS
END| MEMORY LOCATION (INPUT) | MEMORY LOCATION (OUTPUT) |
|---|---|
| 1200:12 | 1204:44 |
| 1201:34 | 1205:51 |
| 1202:12 | 1206:97 |
| 1203:34 | 1207:0A |
-
Load memory location of operands.
-
Perform division.
-
Store result.
CODE SEGMENT
ASSUME CS: CODE, DS: CODE
ORG 1000H
MOV SI,2000H
MOV DX,0000H
MOV AX,[SI]
MOV BX,[SI+02H]
DIV BX
MOV [SI+04H],AX
MOV [SI+06H],DX
MOV AH,4CH
INT 21H
CODE ENDS
END| MEMORY LOCATION (INPUT) | MEMORY LOCATION (OUTPUT) |
|---|---|
| 1200:12 | 1204:01 |
| 1201:34 | 1205:00 |
| 1202:12 | 1206:00 |
| 1203:34 | 1207:00 |
Thus, the Assembly Language Programs for 8086 to perform arithmetic operations (Addition, Subtraction, Multiplication, and Division) using both direct and indirect methods were successfully written and executed using MASM.



