![](/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.