Professional Documents
Culture Documents
BC190405733 Assembly Language
BC190405733 Assembly Language
Questions No 01
Q. Write an assembly language program to add the number of digits of your VUID in pairs
of 3. Suppose your VUID numbers are 123 456 789, all these numbers are added in pairs of
three and converted to 6 15 24, and then find the maximum from these three numbers
here the maximum number is 24 so the number 24 should be shown in the memory
Solution:
[ORG 0X100]
jmp start
a1: dw 0
start:
mov ax,1
mov bx,9
add ax,bx
mov bx,0
add ax,bx
mov [a1+0], ax
mov ax,4
mov bx,0
add ax,bx
mov bx,5
add ax,bx
mov [a1+2], ax
mov ax,7
mov bx,3
add ax,bx
mov bx,3
add ax,bx
mov [a1+4], ax
mov bx,0
mov ax,0
mov ax,[ a1+bx]
peakvalue:
cmp bx,6
je fin
cmp ax,[a1+bx]
jge peakloop
mov ax, [a1+bx]
peakloop:
add bx,2
jmp peakvalue
fin:
MOV Ax,4c00h;
INT 21h
Screenshot 1
Screenshot 2