I’ve already got the program that takes input from the keyboard and print it on the screen but I am having problem understanding few lines of the code,
here is the code,
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
Why we first move 21 of size byte into SNAME ????
How Result of Keyboard input interrupt service automatically stored in SNAME instead of AL ???
Check your favorite MSDOS function reference.
You can find there this:
So, 21 sets the maximum number of character that you can read from the keyboard into the buffer.
As for “
How Result of Keyboard input interrupt service automatically stored in SNAME instead of AL ???“, the question is unclear.