帮忙显示 结果
data segmentM db 12,-35,-51,35,-16,6,13,-10,32,15,-7,-5,8,19,65,-19,14,-30 ;定义数组
P db 20 dup(?)
N db 20 dup(?)
data ends
code segment
assume ds:data,cs:code
main proc far
start:
mov ax,data
mov ds,ax
mov cx,14h ;循环次数
mov si,0
mov bx,0
mov bp,0
L1:
mov ax,M[si] ;开始与零比较
cmp ax,0
jae L2 ;大于等于0运行L2
jb L3 ;小于0运行L3
L2:
mov P[bx],ax ;把大于等于0的数存进数组P
inc bx ;bx用来记录数组长度
loop L1
L3:
mov N[bp],ax
inc bp
loop L1
mov ah,4ch
int 21h
ret
main endp
code ends
end start