Skip to content

rak2018/Arithmetic-operation-using-8086

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

8 Commits
 
 

Repository files navigation

Arithmetic-operation-using-8086

8086 Assembly Language Programs for Arithmetic Operations

AIM

To write and execute Assembly Language Programs to perform arithmetic operations for the 8086 microprocessor.


APPARATUS REQUIRED

  • Personal Computer with MASM Software

1. ADDITION

Algorithm

  1. Initialize memory location in HL register.
  2. Store 1st data.
  3. Increment HL to enter 2nd data.
  4. Move 2nd number to accumulator.
  5. Decrement HL.
  6. Add value in memory with accumulator.
  7. Store result.
  8. Stop.

FLOW CHART

image

Program

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

Output Table

MEMORY LOCATION (INPUT) MEMORY LOCATION (OUTPUT)
1200:12 1204:24
1201:34 1205:68
1202:12 1206:00
1203:34 1207:C4

Manual Calculations

(Add your calculation here) WhatsApp Image 2025-08-28 at 10 03 10_ce71bf9e


OUTPUT IMAGE FROM MASM SOFTWARE

Screenshot 2025-08-21 120000

2. SUBTRACTION

Algorithm

  1. Initialize memory and store 1st data.
  2. Increment to get 2nd data.
  3. Move 2nd data to accumulator.
  4. Subtract memory content.
  5. Store result.

FLOWCHART

image

Program

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

Output Table

MEMORY LOCATION (INPUT) MEMORY LOCATION (OUTPUT)
1200:12 1204:00
1201:34 1205:00
1202:12 1206:00
1203:34 1207:C4

Manual Calculations

(Add your calculation here)

WhatsApp Image 2025-08-28 at 10 06 34_b51b488a


OUTPUT SCREEN FROM MASM SOFTWARE

Screenshot 2025-08-24 123315

3. MULTIPLICATION

Algorithm

  1. Initialize memory and store operands.
  2. Move operands to registers.
  3. Multiply.
  4. Store result.

##FLOWCHART

image

Program

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

Output Table

MEMORY LOCATION (INPUT) MEMORY LOCATION (OUTPUT)
1200:12 1204:44
1201:34 1205:51
1202:12 1206:97
1203:34 1207:0A

Manual Calculations

Add your calculation here) WhatsApp Image 2025-08-28 at 11 12 17_38f4e5b8

OUTPUT SCREEN FROM MASM SOFTWARE

Screenshot 2025-08-27 221001

4. DIVISION

Algorithm

  1. Load memory location of operands.

  2. Perform division.

  3. Store result.

    FLOWCHART

image

Program

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

Output Table

MEMORY LOCATION (INPUT) MEMORY LOCATION (OUTPUT)
1200:12 1204:01
1201:34 1205:00
1202:12 1206:00
1203:34 1207:00

Manual Calculations

(Add your calculation here) WhatsApp Image 2025-08-28 at 11 20 55_d846abb1

OUTPUT FROM MASM SOFTWARE

Screenshot 2025-08-27 223504

RESULT

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.

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published