Upload Cs 401 Ass 2
Upload Cs 401 Ass 2
(CS401P)
Assignment No. 2
Solution:
Code:
st db 2, 3, 0, 2, 1, 8, 9, 0, 2
start:
; Initialize sum to 0
; Add the digits from the array to AL (AX will hold the sum)
mov [sum], al ; Store the sum in the sum variable (Memory Area 1)
mov dx, 0
jmp done
divisible_by_3:
; If divisible by 3, store 1 in DX
mov dx, 1
done:
Screenshot