0% found this document useful (0 votes)
10 views3 pages

CS401P Ass 1 by Saadix

The document outlines an assignment for a CS401p course requiring the creation of an assembly language program. The program must store the numeric part of a VUID, identify the smallest odd number from it, and add each digit to this smallest odd number, storing the results in a second array. The provided code demonstrates the implementation of these tasks using assembly language instructions.

Uploaded by

rabiaaiman111
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
10 views3 pages

CS401P Ass 1 by Saadix

The document outlines an assignment for a CS401p course requiring the creation of an assembly language program. The program must store the numeric part of a VUID, identify the smallest odd number from it, and add each digit to this smallest odd number, storing the results in a second array. The provided code demonstrates the implementation of these tasks using assembly language instructions.

Uploaded by

rabiaaiman111
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 3

Name: Muhammad Saad

ID: BC230427138
Subject: CS401p
Assignment #1
Q.1) 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 smallest odd number of your VUID and store it in memory.
c) Add each numeric digit of your VUID to the smallest odd number (computed in part
b) and store it in a 2nd array.
Solution:
[org 0x0100]
jmp start

vuid db 2,3,0,4,2,7,1,3,8
sm_odd db 0
result times 9 db 0
start:
mov si, 0
mov bl, 0FFh

find_odd:
mov al, [vuid + si]
test al, 1
jz not_odd
cmp al, bl
jae not_odd
mov bl, al

not_odd:
inc si
cmp si, 9
jl find_odd

mov [sm_odd], bl
mov si, 0
mov al, [sm_odd]
add_loop:
mov bl, [vuid + si]
add bl, al
mov [result + si], bl
inc si
cmp si, 9
jl add_loop
; Exit program
mov ax, 0x4C00
int 0x21
Screenshot

You might also like

pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy