玩緊個password program, 當user 係keyboard 打a - z 時用_GetCh 去get user keyboard input 然後mask 哂做 *,但唔知點解唔work.....有冇師兄幫到手?
唔該- .model small
- .586
- .stack 100h
- INCLUDE PCMAC.INC
- .DATA
- MSG DB 'Enter Password:
- PWD DB 'abcd'
- .CODE
- PASSWORD PROC
- mov ax, @DATA
- mov ds, ax
- mov dx, offset pwd
- GetLoop:
- _Begin
- _PutStr msg
- _GetCh noEcho
- cmp al, 13
- je DONE
- cmp al, 'a'
- jnae al, EchoIt
- cmp al, 'z'
- jnbe al, EchoIt
- add al, '*'
- EchoIt:
- _PutCh al
- jmp GetLoop
- DONE:
- _Exit 0
- PASWORD ENDP
- END PASSWORD
複製代碼 |