?? 56.asm
字號(hào):
;56.asm
datasg segment
m db 1,2,3,4,5,6,7,8,9,0,-1,-2,-3,-4,-5,-6,-7,-8,-9,-10
p db 20 dup(?)
countp db 'positive data:',?,?,13,10,'$'
n db 20 dup(?)
countn db 'negative data:',?,?,13,10,'$'
datasg ends
codesg segment
assume cs:codesg,ds:datasg
main proc far
start:
push ds
sub ax,ax
push ax
mov ax,datasg
mov ds,ax
mov cx,20
mov bx,0
mov si,bx
mov di,bx
loop1: cmp m[bx],0
jg positive
jl negative
jmp short next
positive:mov al,m[bx]
mov p[si],al
inc si
jmp short next
negative:mov al,m[bx]
mov n[di],al
inc di
next: inc bx
loop loop1
mov bl,10d
mov ax,si
div bl
add ax,3030h
mov [countp+14],al
mov [countp+15],ah
mov ax,di
div bl
add ax,3030h
mov [countn+14],al
mov [countn+15],ah
lea dx,countp
mov ah,09
int 21h
lea dx,countn
mov ah,09
int 21h
ret
main endp
codesg ends
end start
?? 快捷鍵說(shuō)明
復(fù)制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號(hào)
Ctrl + =
減小字號(hào)
Ctrl + -