ASSEMBLY LANGUAGE PROGRAMMING
ALP for addition of two 8-bit numbers ALP for
Subtraction of two 8-bit
DATA
SEGMENT numbers
VAR1 DB
85H DATA
SEGMENT
VAR2 DB
32H VAR1
DB 53H
RES DB? VAR2
DB 2AH
DATA ENDS RES
DB?
ASSUME
CS:CODE, DS:DATA DATA ENDS
CODE
SEGMENT ASSUME
CS:CODE,DS:DATA
START:
MOV AX, DATA CODE
SEGMENT
MOV DS,
AX START:
MOV AX,DATA
MOV AL,
VAR1 MOV
DS,AX
MOV BL,
VAR2 MOV
AL,VAR1
ADD AL,
BL MOV
BL,VAR2
MOV RES,
AL SUB
AL,BL
MOV AH,
4CH MOV
RES,AL
INT 21H MOV
AH,4CH
CODE ENDS INT
21H
END START CODE
ENDS
END START
ALP for Multiplication of two 8-bit numbers
DATA
SEGMENT
VAR1 DB
0EDH
VAR2 DB
99H
RES DW?
DATA ENDS
ASSUME
CS: CODE, DS:DATA
CODE
SEGMENT
START:
MOV AX, DATA
MOV DS,
AX
MOV AL,
VAR1
MOV BL,
VAR2
MUL BL
MOV RES,
AX
MOV AH,
4CH
INT 21H
CODE ENDS
END START
ALP for division of 16-bit number with 8-bit number
DATA
SEGMENT
VAR1 DW
6827H
VAR2 DB
0FEH
QUO DB?
REM DB?
DATA ENDS
ASSUME
CS:CODE,DS:DATA
CODE
SEGMENT
START:
MOV AX, DATA
MOV DS,
AX
MOV AX,
VAR1
DIV VAR2
MOV QUO,
AL
MOV REM,
AH
MOV AH,
4CH
INT 21H
CODE ENDS
END START
ALP for Subtraction of two 16-bit numbers
DATA
SEGMENT
VAR1 DW
8560H
VAR2 DW
3297H
RES DW?
DATA ENDS
ASSUME
CS: CODE,DS:DATA
CODE
SEGMENT
START:
MOV AX, DATA
MOV DS,
AX
MOV AX,
VAR1
CLC
SUB AX,
VAR2
MOV RES,
AX
MOV AH,
4CH
INT 21H
CODE ENDS
END START
Related Topics
Privacy Policy, Terms and Conditions, DMCA Policy and Compliant
Copyright © 2018-2023 BrainKart.com; All Rights Reserved. Developed by Therithal info, Chennai.