Mic PR 4

You might also like

Download as docx, pdf, or txt
Download as docx, pdf, or txt
You are on page 1of 2

Practical No: 4

;WALP to multiply two 8-bit and 16-bit numbers.


Program:-

SIGNED NUMBER UNSIGNED NUMBER


assume cs:code assume cs:code
assume ds:data assume ds:data
data segment data segment
a db 05h a db 20h
b db 10h b db -10h
c dw ? c dw ?
a1 dw 1234h a1 dw 1234h
b1 dw 1000h b1 dw -1000h
sum dd ? sum dd ?
ends data ends data
code segment code segment
start: start:
mov ax,data mov ax,data
mov ds,ax mov ds,ax
mov ax,0000h mov ax,0000h
mov al,a mov al,a
mov bl,b mov bl,b
mul bl mul bl
mov c,ax mov c,ax
mov ax,0000h mov ax,0000h
mov bx,0000h mov bx,0000h
mov ax,a1 mov ax,a1
mov bx,b1 mov bx,b1
imul bx imul bx
lea si, sum lea si,sum
mov [si],al mov [si],al
mov [si+1],ah mov [si+1],ah
mov [si+2],dl mov [si+2],dl
mov [si+3],dh mov [si+3],dh
int 03h int 03h
ends code ends code
end start end start
output:-

You might also like