You are on page 1of 5

CS401 ASSIGNMENT 1 SOLUTION SPRING 2024

Due Date: 29-Apr-2024


Total Marks: 20

You are supposed to submit your assignment in .doc or docx format.

You are required to write an assembly language program to perform the following tasks:
a) Store the numeric part of your VUID in an array of numbers in memory.
b) Find the largest numeric digit of your VUID and store it in memory.
c) Subtract each numeric digit of your VUID from the largest digit (found in part b) and
store it in a 2nd array.
d) Sort and store updated VUID in ascending order in a 3rd array.
Note: You must use your own VUID. For example, if your VUID is BC230412545, the numeric
part will be 230412545.
Submission details:
Following are required in a single MS-Word document.
a) Assembly language program.
b) Screenshot showing the results.

FOR PAID CORRECT SOLUTION WITH YOUR OWN ID CONTACT


WHATSAPP 03162965677

CODE Solution:
[org 0x0100]
jmp start

JOIN WHATSAPP GROUP


https://chat.whatsapp.com/IF8sHHq2GYz8BJwG9XEJB1
id: db 2,1,0,2,0,7,6,5,4
grt: db 0
subresult: db 0,0,0,0,0,0,0,0,0
sortresult: db 0,0,0,0,0,0,0,0,0
swap: db 0
start: mov cx,9
mov bl,0
mov si,id
up: mov al,[si]
cmp al,bl
jl next
mov bl,al

next: inc si
dec cx
jnz up

mov [grt],bl
mov si,id
mov di,0
mov cx,9
mov bl,0

subroutine: mov al,[si]


mov bl,[grt]

JOIN WHATSAPP GROUP


https://chat.whatsapp.com/IF8sHHq2GYz8BJwG9XEJB1
sub bl,al
mov[subresult+di],bl
inc si
inc di
dec cx
jnz subroutine

mov bx,sortresult
mov cx,8
main: mov si,0
mov byte [swap],0

inner: mov al,[bx+si]


cmp al,[bx+si+1]
jbe noswap

mov dl,[bx+si+1]
mov [bx+si],dl
mov [bx+si+1],al
mov byte [swap],1

noswap: add si,1


cmp si,cx
jne inner
cmp byte [swap],1

JOIN WHATSAPP GROUP


https://chat.whatsapp.com/IF8sHHq2GYz8BJwG9XEJB1
je main
mov ax,0x4c00
int 0x21

OUTPUT SCREENSHOT:

JOIN WHATSAPP GROUP


https://chat.whatsapp.com/IF8sHHq2GYz8BJwG9XEJB1
REGARD - SARIM
WHATSAPP +923162965677

PLEASE NOTE:
Don't copy-paste the same answer.
Make sure you can make some changes to your solution file before
submitting copy paste solution will be marked zero.
If you found any mistake then correct yourself and inform me.
Before submitting an assignment must check your assignment requirement
file.
If you need some help or question about file and solutions feel free to ask.

FOR FREE ASSIGNMENTS SOLUTIONS VISIT

VUStudentspk.com

JOIN WHATSAPP GROUP


https://chat.whatsapp.com/IF8sHHq2GYz8BJwG9XEJB1

You might also like