当前位置:网站首页>Njupt South Post collection_ Experiment 2
Njupt South Post collection_ Experiment 2
2022-06-11 00:10:00 【Retreat drum ten level performer】
Implementation of user login authentication program
The experimental requirements : After the program is executed , Give operation tips , Ask the user to type the user name and password ; The user is typing a password , The program does not echo typed characters ; Only when the user types the user name 、 The password string is the same as the string specified in the program , Show welcome screen , And back to DOS. The interface color is customized ( Color or black and white ).
DATAS SEGMENT
STR1 DB 'Please enter your username: $'
STR2 DB 0AH,0DH,'Please enter your password: $'
STR3 DB 0AH,0AH,'Input error!',0DH,0AH,'Please input again$'
STR4 DB 'WELCOM!'
BUF1 DB 15 ; Store input user name
DB ?
DB 15 DUP(?)
BUF2 DB 15 DUP(?)
USERNAME DB 'root'
PASSWORD DB '123456'
DATAS ENDS
CODES SEGMENT
ASSUME CS:CODES,DS:DATAS,ES:DATAS
START:
MOV AX,DATAS
MOV DS,AX
MOV ES,AX
MOV SI,0
BEG:
; Display prompt message
MOV AH,09H
MOV DX,OFFSET STR1
INT 21H
; enter one user name
MOV AH,0AH
MOV DX,OFFSET BUF1
INT 21H
; Display prompt message
MOV AH,09H
MOV DX,OFFSET STR2
INT 21H
; Input password
INPUT:
MOV AH,07H
INT 21H
MOV BUF2[SI],AL
CMP AL,0DH
JE OVER ; If enter enter , End of surface user input
INC SI
MOV AH,02H
MOV DL,'*'
INT 21H
JMP INPUT
OVER:
; Determine if the user name is correct
MOV SI,OFFSET BUF1[2]
MOV DI,OFFSET USERNAME
MOV CX,4
CLD
REPZ CMPSB
JNZ ERROR ; Incorrect user name
; Determine if the password is correct
MOV SI,OFFSET BUF2
MOV DI,OFFSET PASSWORD
MOV CX,6
CLD
REPZ CMPSB
JNZ ERROR ; Incorrect password
; Show welcome screen
MOV AX,0003H
INT 10H
MOV AX,1301H
MOV BH,0
MOV BL,01001111B
MOV CX,7
MOV DH,12
MOV DL,(80-7)/2
MOV BP,OFFSET STR4
INT 10H
JMP RETURN
; Display error
ERROR:
MOV AH,09H
MOV DX,OFFSET STR3
INT 21H
JMP BEG
RETURN:
MOV AH,4CH
INT 21H
CODES ENDS
END START


边栏推荐
- Typecho website speed optimization - Xingze V Club
- Compared with the "South-to-North Water Transfer", what will the "east to west" of the fire bring to cloud computing?
- 数据库表结构
- Read it once: talk about MySQL master-slave
- Kubernetes 基本介绍及核心组件
- Basic operation of OpenCV actual combat image: this effect amazed everyone (with code analysis)
- How to measure the refresh rate of oscilloscope
- High speed data stream disk for LabVIEW
- 【自动回复or提醒小助手】妈妈再也不用担心我漏掉消息了(10行代码系列)
- LabVIEW uses the visa read function to read USB interrupt data
猜你喜欢

Easyrecovery15 simple and convenient data recovery tool

【Turtle表白合集】“海底月是天上月,眼前人是心上人。”余生多喜乐,长平安~(附3款源码)
![[pyGame games] I'm not afraid you can't walk the maze series: the ultimate AI walks the maze. After learning, it will take you to open the door to a new world ~ (with game source code)](/img/57/dcf291b044b5e5860a7fdc817076d5.jpg)
[pyGame games] I'm not afraid you can't walk the maze series: the ultimate AI walks the maze. After learning, it will take you to open the door to a new world ~ (with game source code)

【Pygame小游戏】趣味益智游戏 :打地鼠,看一下能打多少只呢?(附源码)

Things about Bluetooth development (1) -- starting with packet capturing data

From the perspective of Confucius Temple IP crossover, we can see how the six walnuts become "butterflies" for the second time

【颜值检测神器】来,请拿出你们的绝活(这颜值,对得起观众么?)

【Opencv实战】这个印章“神器”够牛,节省了时间提高了效率,厉害~(附完整源码)

SystemVerilog (x) - user defined type

Compared with the "South-to-North Water Transfer", what will the "east to west" of the fire bring to cloud computing?
随机推荐
Binary tree pruning
快速排序
Leetcode-209 minimum length subarray
Self made app connected to onenet --- realize data monitoring and distribution control (mqtt)
Error report of curl import postman
[daily] robots Txt allow all search engines to include
示波器和频谱分析仪的区别
集合删除元素技巧 removeIf
【Pygame小游戏】不怕你走不过系列:极致AI走迷宫,学习完带你打开新世界大门~(附游戏源码)
对接请求方式
WinDriver compilation summary
[turtle confessions collection] "the moon at the bottom of the sea is the moon in the sky, and the person in front of us is the sweetheart." Be happy for the rest of your life, and be safe for ever ~
From the perspective of Confucius Temple IP crossover, we can see how the six walnuts become "butterflies" for the second time
ASP. Net programming version C (notes along with learning progress)
关于优化API接口响应速度
The website is harmed by XSS hanging horse
Things about Bluetooth development (10) -- getting to know ble for the first time
SystemVerilog (x) - user defined type
CSDN daily practice - find the closest element and output the subscript
启牛学堂理财可靠吗,安全吗