CS401 Assignment 1 Solution Spring 2024
CS401 Assignment 1 Solution Spring 2024
CS401 Assignment 1 Solution Spring 2024
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.
CODE Solution:
[org 0x0100]
jmp start
next: inc si
dec cx
jnz up
mov [grt],bl
mov si,id
mov di,0
mov cx,9
mov bl,0
mov bx,sortresult
mov cx,8
main: mov si,0
mov byte [swap],0
mov dl,[bx+si+1]
mov [bx+si],dl
mov [bx+si+1],al
mov byte [swap],1
OUTPUT SCREENSHOT:
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.
VUStudentspk.com