data segment
a1 dw 0f252h
b1 dw 20h
c1 dw ?
d1 dw ?
data ends
cseg segment
assume cs:cseg, ds:data
start:
mov ax, data
mov ds, ax
mov ax, a1
xor dx, dx
div b1
mov c1, ax
mov d1, dx
mov ah,4ch
int 21h
cseg ends
end start
;2-------------------
data segment
buf db 1,0,3,0,5,0,7,0,0,1
cnt equ $-buf
data ends
cseg segment
assume cs:cseg, ds:data
start:
mov ax, data
mov ds, ax
lea si, buf
mov cx, cnt
mov bx, 0
m0:
mov al, [si]
cmp al, 0
jnz m1
inc bx
m1:
inc bx
loop m0
;测试奇偶
test bx, 1
jz even0
setc
jmp exit
even0:
clc
exit:
mov ah,4ch
int 21h
cseg ends
end start