定义字型变量,随便给定10个初始值,求其中负数的个数,将其结果存入AX中

来源:百度知道 编辑:UC知道 时间:2024/05/11 02:26:17

data segment
db 10,20,30,40,50,60,70,80,1f,12
data ends
result segment
result ends
code segment
start: mov ax,data
mov ds,data
mov ax,result
mov es,ax
mov cx,0
mov si,0
next: mov al,byte ptr [si]
cmp al,7fh
jnb nofind
inc cx
nofind:cmp byte ptr [si],0
je judge
$$: inc si
jmp next
judge: cmp byte ptr [si+1],0
je over
jmp $$
over: mov es:[0],cx
mov ax,4c00h
int 21h
code ends
end start