You are on page 1of 4

Virtual University of Pakistan

CS401
Computer Architecture and Assembly Language
Assignment no. 1

Submitted by:
Memona Raza
BC210428921
December 6th , 2022
Question statement 1
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 0x0100]

jmp start

bts1: dw 0
start:

mov ax, 2
mov bx, 1
add ax, bx
mov bx, 0
add ax, bx
mov [bts1+0], ax

mov ax, 4
mov bx, 2
add ax, bx
mov bx, 8
add ax, bx
mov [bts1+2], ax
mov ax, 9
mov bx, 2
add ax, bx
mov bx, 1
add ax, bx
mov [bts1+4], ax
mov bx,0
mov ax,0
mov ax, [bts1+bx]

culmination:
cmp bx,6
je fin
cmp ax, [bts1+bx]
jpe culminationloop
mov ax, [bts1+bx]

culminationloop:
add bx,2
jmp culmination
fin:

MOV AX, 4C00h;


INT 21h

Screenshots are attached below


‘Initial screenshot’

‘End Screenshot’

You might also like