Ok yeah use the basic old int 16h works lovely, but what if lets say I want to make a delete function or an insert function so they don't have to delete the enter string. If dos has a system for this please let me know.
INT 21h, Function 63h, Handle 0 will read data from the keyboard the same way as readln in pascal or gets in C.
INT 21h, Function 64H Handle 1 will write to the screen in the same way as Write in pascal, or puts in C.
In my reference for DOS, Int 21h function 63h accesses special OS data for DOS 2.25 (a ROM-based DOS). I doubt it will work for all versions. One function which WILL work for all versions is Int 21h function 0Ah.
input:
AH=0ah
DSX=pointer to buffer.
returns:
DSX+1=length of input string
DSX+2=string
Buffer is specially formatted.
DSX+0 = maximum buffer length excluding lead bytes
DSX+1 = length of string in buffer
DSX+2 = actual buffer
What does DSX+1 hold? Length of string in buffer? WEll, if you work exclusively in the DOS command prompt, you will find that pressing F3 accesses the last input you typed, and F2 accesses the last input up to the first occurence of a selected character, you can use INS to insert characters than type F3/F2, right key shows the previous input, etc. That's because COMMAND.COM uses the fucntion 0Ah. It initially stores 80 to DSX, 0 to DSX+1, calls 0Ah, processes the command, then calls 0Ah without bothering to change DSX+1.
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.