Professional Documents
Culture Documents
Cs401 Assign 1 Sol Spring 2023 Vu Expert
Cs401 Assign 1 Sol Spring 2023 Vu Expert
Cs401 Assign 1 Sol Spring 2023 Vu Expert
Question No 2 Solution:
set address = Physical address — segment address* 10h
4A37bH — 4OFFh *
10h
c)4c
Question No 1 Solution:
[org Ox0100]
.41414 c
1 °11111111 1"
66...,
jmp moo
msgl db 'number is even', 'V
rnsg2 db 'number is odd', %Iiir
s I : dw 1, 9, 0, 4,
own VUID
N„ 9, 0, 7 // enter your
moo:
mov bx,0
mov cx,9
For paid assignment
contact:
+92308972787
For paid assignment contact: +92308972787
= 4A37bH — 4OFF0 Offset address = 938B
mov ax, 0
lop:
odd:
add ax,
mov SI,msg2 mov DX,SI mov AH,09H
[sl+bx] add
bx,2paid assignment contact: +92308972787
For
sub cx,1
cmp cx,0
mov bx,
ax and
bx, 1
cmp bx,
evn:
mov
For paid assignment contact:
INT
exit:
mop
ax,0x4c00 int
Outpu
DOSBox 0.74, Cpu speed: 3000 cycles, Frameskip 0, Program:
i:›nasm stat.asm -u
,tat.asm:28: error: expression syntax
:\>nasm stat.asm -o
tat.asm:241: error: symbol 'odd' undefined
,tat.asm:31: error: symbol 'exit' undefined
:'>nasm stat.asm -o
. ta t. as m: Z4 : er ro r: sym bo l 'o dd' u ndefi n ed
t a t . a s m : 3 1 : e r r o r : s y m bo l 'e xi t ' u n de fi n e d
,:\>nasm stat.asm -o
1:\>stat.com lumber is
e v e n 1:\>stat.com 'lumber
is even i:\ >nasm stat.asm -o
stat.com
1: ■,>stat.co