?? password.asm
字號:
dseg segment
mess1 db "select 1--Set password",0ah,0dh
db "select 2--display password",0ah,0dh
db "select 3--check passwork",0ah,0dh
db "select other keys--quit",0ah,0dh,"$"
mess2 db "Input your selection:",0ah,0dh,"$"
mess3 db "999999",0ah,0dh,"$"
mess4 db "your password is error,please check!",0ah,0dh,"$"
mess5 db "your password is right,please countiune",0ah,0dh,"$"
mess6 db "please input your 6s password:","$"
xing db "*","$"
endbz db 0ah,0dh,"$"
dseg ends
sseg segment stack
db 80h dup(0)
sseg ends
cseg segment
assume ds:dseg,ss:sseg,cs:cseg
;************進行菜單的設計******************
start: mov ax, dseg
mov ds, ax
mov dx, offset mess1
mov ah,09h
int 21h
mov dx, offset mess2
mov ah,09h
int 21h
mov ah,08h
int 21h
and al, 0fh
cmp al, 1
jz setpass ;輸入1則進行密碼設定
cmp al, 2
jz display ;輸入2顯示密碼
cmp al, 3
jz check ;輸入3修改密碼
jmp end0
setpass: ;進行密碼設定
mov dx, offset mess6
mov ah,09h
int 21h
mov cl,6
mov dx, offset mess3
mov bx, dx
loop0: mov ah,08h
int 21h
mov [bx], al
mov dx ,offset xing
mov ah,09h
int 21h
inc bx
dec cl
jnz loop0
mov dx, offset endbz
mov ah,09h
int 21h
jmp start
check: mov dx, offset mess6
mov ah, 09h
int 21h
mov cl,6
mov dx, offset mess3
mov bx, dx
loop1: mov ah,01h
int 21h
cmp [bx], al
jnz error
inc bx
dec cl
jnz loop1
mov dx, offset endbz
mov ah, 09h
int 21h
mov dx, offset mess5
mov ah, 09h
int 21h
jmp start
error: mov dx, offset endbz
mov ah, 09h
int 21h
mov dx, offset mess4
mov ah, 09h
int 21h
jmp start
display: mov dx, offset mess3 ;密碼的顯示
mov ah,09h
int 21h
jmp start
end0: mov ah,4ch ;退出
int 21h
cseg ends
end
?? 快捷鍵說明
復制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號
Ctrl + =
減小字號
Ctrl + -