0% found this document useful (0 votes)
15 views2 pages

CS401 Sol-25

This document presents a solution to an assignment on Computer Architecture and Assembly Language Programming (CS401). It includes assembly code that calculates the sum of an array of values and performs a subtraction loop. The code is structured with labels and instructions for data manipulation and control flow.

Uploaded by

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

CS401 Sol-25

This document presents a solution to an assignment on Computer Architecture and Assembly Language Programming (CS401). It includes assembly code that calculates the sum of an array of values and performs a subtraction loop. The code is structured with labels and instructions for data manipulation and control flow.

Uploaded by

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

ASSIGNMENT Solution By Gateway RAja MUshTaQ

Computer Architecture and Assembly Language Programming


(CS401)
Assignment No. 1
Solution

[org 0x0100]

jmp start

vuid db 2,1,0,4,0,6,5,3,0

sum dw 0

result db 9

start:

mov ax, 0

mov si, 0

calculation_sum:

mov al, [vuid + si]

add ah,

al inc si

cmp si, 9

jl calculation_sum

mov [sum], ah

mov si, 0

mov bl, ah

subtract_loop:

mov al, [vuid + si]

mov bh, bl

sub bh, al

https://chat.whatsapp.com/GecIrau2Nit0D4F5DjDiGM
ASSIGNMENT Solution By Gateway RAja MUshTaQ

mov [result + si], bh

inc si cmp si, 9

jl subtract_loop

mov ax, 4c00h

int 21h

Sample screenshot:

https://chat.whatsapp.com/GecIrau2Nit0D4F5DjDiGM

You might also like