9、《MS-DOS 文件管理程序 DUMP 的分析与比较》

《MS-DOS 文件管理程序 DUMP 的分析与比较》

1. 关键代码解读

首先来看一段关键代码,它用于处理用户响应并根据用户输入设置相应的操作代码:

in t2 4 a : mov
ax.seg prompt 
; display prompt for user
mov
d s .a x  
; using function 9 (print string
mov
e s .a x  
; terminated by $ character)
mov
d x . o f f s e t  prompt
mov
a h ,9
1 n t
21 h
mov
a h , 1 
; get user's response
i n t
21h 
; function 1 - read one character
mov
d i , o f f s e t  keys 
; look up code for response key
mov
c x ,k e y s _ le n
cl d
repne
scasb
jn z
in t2 4 a  
; prompt again if bad response
; set AL - action code for MS-DOS 
; according to key that was entered:
; 0 - ignore. 1 - retry.  2 - abort.
; 3 - fail
mov
a l , [d i+ k e y s _ le n - 1 ]
pop
es 
; restore registers
pop
ds
pop
bp
pop
di
pop
si
pop
dx
pop
cx
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值