现在汇编忘记的查不多了~
data segment
passw db ‘123456’
buf db 80,81 dup(0)
disp1 db 13,10,’password is true.try time=$’
disp2 db 13,10,’password is ereer.$’
data ends
code segment
assume cs:code,ds:data
main:mov ax,data
mov ds,ax
mov es,ax
mov bl,0
again:mov ah,10
lea dx,buf
int 21h
inc bl
mov cl,[buf+1]
mov ch,0
cmp cx,offset buf – offset passw
jne lab1
lea si,passw
lea di,buf+2
cld
repz cmpsb
jz disp
lab1:cmp bx,3
jae err
jmp again
disp:lea dx,disp1
mov ah,9
int 21h
mov ah,2
add bl,30h
mov dl,bl
int 21h
jmp exit
err:lea dx,disp2
mov ah,9
int 21h
exit:mov ah,4ch
int 21h
code ends
end main
汇编 输入密码.并严整在第几次正确.次数为3次(效果图)
- THE END -
Category: 汇编
0 条评论。