Answer to Question #162621 in Assembler for passout

Question #162621

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-12T18:17:09-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          ; 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


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