|
马上注册,结交更多好友,享用更多功能^_^
您需要 登录 才可以下载或查看,没有账号?立即注册
x
stack segment stack'stack'
dw 32 dup(0)
stack ends
data segment
ibuf db 7,0,7 dup(0)
ibuf1 dw 50 dup(0)
obf db'qing shu ru yi chuan shu zi:$'
obf1 dw 0
obf2 dw 0
obf3 dw 0
data ends
code segment
assume ss:stack,cs:code,ds:data
push ds
sub ax,ax
push ax
start: mov ax,data
mov ds,ax
mov di,offset ibuf1
mov si,offset ibuf1
mov cx,10
mov dx,offset obf
mov ah,9
int 21h
mov ah,2
mov dl,0dh
int 21h
mov dl,0ah
int 21h
again: call input1
mov bx,binary
mov [di],bx
add di,2
loop again
mov ibuf1[di],'$'
mov dx,offset ibuf1
mov ah,9
int 21h
mov ah,2
mov dl,0dh
int 21h
mov dl,0ah
int 21h
next: mov ax,[si]
add si,2
and ax,ax
jz again1
js again2
jns again3
again1: inc obf1
loop next
again2: inc obf2
loop next
again3: inc obf3
loop next
mov dl,obf1+30h
mov ah,2
int 21h
mov ah,2
mov dl,0dh
int 21h
mov dl,0ah
int 21h
mov dl,obf2+30h
mov ah,2
int 21h
mov ah,2
mov dl,0dh
int 21h
mov dl,0ah
int 21h
mov dl,obf3+30h
mov ah,2
int 21h
mov ah,4ch
int 21h
input1 proc
mov dx,offset ibuf
mov ah,10
int 21h
mov cl,ibuf+1
mov ch,0
mov si,offset ibuf+2
cmp byte ptr[si],'-'
pushf
jne sininc
inc si
dec cx
sininc:mov ax,0
again: mov dx,10
mul dx
and byte ptr[si],0fh
add al,[si]
adc ah,0
inc si
loop again
popf
jnz nneg
neg ax
nneg: mov binary,ax
ret
input1 endp
code ends
end start求帮忙修改
|
|