0% found this document useful (0 votes)
10 views

cs401pAss

Uploaded by

mishalaslam17
Copyright
© © All Rights Reserved
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
10 views

cs401pAss

Uploaded by

mishalaslam17
Copyright
© © All Rights Reserved
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 3

Assignment No.

Code :
[org 0x0100]

jmp start

id db 2,3,0,2,0,8,6,8,4

sum: dw 0

start:

mov cx, 9

mov si, id

xor ax, ax

sum_loop:

movzx bx, byte [si]

add ax, bx

inc si
loop sum_loop

mov [sum], ax

mov dx, 0

mov bx, 3

div bx

cmp dx, 0

je divisible_by_3

jmp not_divisible

divisible_by_3:

mov dx, 1

jmp done

not_divisible:

mov dx, 0
done:

; Display the result here (optional)

mov ax, 0x4C00

int 0x21

Screen Shot Output :

You might also like