Answer to Question #163900 in Assembler for thammineni hemanth

Question #163900

Write an assembly program for multiplication of two eight bit no. at 4000H=1BH and 4001H=3AH and save result at 4002H and 4003H.


1
Expert's answer
2021-02-26T19:54:38-0500

; DosBox

DATA SEGMENT

DATA ENDS

 

CODE SEGMENT

ASSUME DS:DATA,CS:CODE

START:

    MOV AX, DATA

    MOV DS, AX

 

; 4000H = 1BH

    mov di, 4000h          ; di = 4000h

    mov al, 1bh               ; al = num1 = 1Bh

    mov [di], al                ; save num1 in [di]

 

;  4001H = 3AH

    mov di, 4001h         ; di = 4001h

    mov al, 3ah              ; al = num2 = 3Ah

    mov [di], al               ; save num2 in [di]

 

    mov si, 4000h         ; si = 4000h

    mov al, [si]               ; al = num1 = 1Bh

    mov si, 4001h          ; si = 4001h

    mov cl, [si]               ; cl = num2 = 5Ah

 

; num1*num2

    mul  cl                       ; ax = al*cl = num1*num2

    mov di, 4002h         ; di = 4002h

    mov [di], ax             ; save result at 4002h and 4003h

 

EXIT_PROG:                ; Program is terminated

    MOV AH, 4CH

    INT 21H

 

CODE ENDS

END START


Need a fast expert's response?

Submit order

and get a quick answer at the best price

for any assignment or question with DETAILED EXPLANATIONS!

Comments

No comments. Be the first!

Leave a comment

LATEST TUTORIALS
New on Blog
APPROVED BY CLIENTS