0% found this document useful (0 votes)
20 views3 pages

Mic PR 16

The document outlines a program for performing arithmetic operations (addition, subtraction, multiplication, and division) using assembly language procedures. It defines data segments for input values and results, and includes procedures for each arithmetic operation. The program structure includes calls to these procedures and handles the results accordingly.

Uploaded by

arqamqazi549
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
20 views3 pages

Mic PR 16

The document outlines a program for performing arithmetic operations (addition, subtraction, multiplication, and division) using assembly language procedures. It defines data segments for input values and results, and includes procedures for each arithmetic operation. The program structure includes calls to these procedures and handles the results accordingly.

Uploaded by

arqamqazi549
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 3

Practical No: 16

;ALP addition, subtraction, Multiplication and Program:


division using procedure ASSUME CS:CODE
Program: ASSUME DS:DATA
ASSUME CS:CODE
DATA SEGMENT
ASSUME DS:DATA A DB 02H
B DB 02H
DATA SEGMENT C DB 02H
N1 DB 10H D DB 02H
N2 DB 05H Z DW ?
R_ADD DB ? DATA ENDS
R_SUB DB ?
CODE SEGMENT
R_MUL DW ? START:
R_DIV DB ? MOV AX, DATA
R_REM DB ? MOV DS, AX
R_QUO DB ? MOV AX, 0000H
DATA ENDS CALL A1
CALL A2
CALL MULTI
CODE SEGMENT
INT 03H
START: A1 PROC
MOV AX, DATA MOV AL,A
MOV DS, AX MOV BL, B
MOV AX, 0000H ADD AL, BL
CALL ADD_N MOV DH, AL
CALL SUB_N MOV AL, 00H
RET
CALL MUL_N A1 ENDP
CALL DIV_N
INT 03H A2 PROC
ADD_N PROC MOV AL, C
MOV AL,N1 MOV BL, D
MOV BL, N2 ADD AL, BL
MOV DL, AL
ADD AL, BL
MOV AL,00H
MOV R_ADD, AL RET
RET A2 ENDP
ADD_N ENDP
MULTI PROC
SUB_N PROC MOV AL, DH
MOV AL, N1 MUL DL
MOV Z, AX
MOV BL, N2
RET
SUB AL, BL MULTI ENDP
MOV R_SUB, AL CODE ENDS
RET END START
SUB_N ENDP

MUL_N PROC
MOV AL,N1
MOV BL,N2
MUL BL
MOV R_MUL, AX
RET
MUL_N ENDP

DIV_N PROC
MOV AL, N1
MOV BL, N2
DIV BL
MOV R_QUO, AL
MOV R_REM, AH
RET
DIV_N ENDP
CODE ENDS
END START
Output:

You might also like