![](/img/trans.png)
[英]Taking input string from keyboard and outputting a string in Assembly (8086)
[英]Taking input from the Keyboard in Assembly (TASM)
我已经有了从键盘输入并在屏幕上打印的程序,但是我在理解代码的几行时遇到了问题,
这是代码,
MOV DS, AX
MOV ES, AX ;Why Move AX content to ES ???
MOV DX, OFFSET PNAME ; PRINT NAME:
MOV AH, 09H
INT 21H
MOV BYTE PTR SNAME, 21
MOV DX, OFFSET SNAME
MOV AH, 0AH
INT 21H
MOV SI, 0002
LEA DX, SNAME[SI] ; PRINT NAME ENTERED
MOV AH, 09H
INT 21H
为什么我们首先将21个大小字节移动到SNAME ???? 键盘输入中断服务的结果如何自动存储在SNAME而不是AL ???
检查您最喜欢的MSDOS功能参考。
你可以找到这个 :
Format of DOS input buffer:
Offset Size Description (Table 01344)
00h BYTE maximum characters buffer can hold
01h BYTE (call) number of chars from last input which may be recalled
(ret) number of characters actually read, excluding CR
02h N BYTEs actual characters read, including the final carriage return
因此,21设置您可以从键盘读取到缓冲区的最大字符数。
至于“ How Result of Keyboard input interrupt service automatically stored in SNAME instead of AL ???
”,问题不清楚。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.