Write an assembly program for multiplication of two eight bit no. at 4000H=1BH and
4001H=3AH and save result at 4002H and 4003H
; DosBox
DATA SEGMENT
DATA ENDS
CODE SEGMENT
ASSUME DS:DATA,CS:CODE
START:
MOV AX, DATA
MOV DS, AX
; 4000H=1BH
mov di,4000h ; address
mov al,1bh ; number1 = 1Bh
mov [di],al ; save number1 in memory: 4000h=1Bh
; 4001H=3AH
mov di,4001h ; address
mov al,3ah ; number2=3Ah
mov [di],al ; save number2 in memory: 4001h=3Ah
mov si,4000h ; address
mov al,[si] ; number1: al = 1Bh
mov si,4001h ; address
mov cl,[si] ; number2: cl = 5Ah
; result = number1*number2
mul cl ; ax = al*cl
mov di,4002h ; address
mov [di],ax ; save result at 4002h and 4003h
EXIT_PROG: ; Program is terminated
MOV AH,4CH
INT 21H
CODE ENDS
END START
Comments
Leave a comment