Closed micahcochran closed 1 year ago
quick comment just to say that a single int 21h, ah=7 is not enough for a "press any key" routine, as it won't handle extended keys (thus pressing an arrow key or any other extended key would be processed as two key presses).
I fixed this in this commit: https://github.com/FDOS/fdisk/pull/39/commits/85840c63577dab47c647a424d2645e8191bb6278
But this would certainly need to be put in one single place as a dedicated function. Perhaps translated to C with intdos(), as suggested in this issue.
I replaced all wait-for-keypress assembly calls by a single function in userint0.c https://github.com/FDOS/fdisk/pull/41/commits/55ad5962dbabc666eb6aed63a4984bab8d7b3797
I think this issue can be closed now.
The code has a number of inline assembly calls for AH=7/INT 21h. Some of these are "press a key" instances. Others use it for accepting keyboard input.
getch() from conio.h is the closest equivalent. But Watcom C uses AH=8/INT 21h, which is similar.
AH=7/INT 21 is direct character input. AH=8/INT 21 is character input checks for Ctrl+Break Ctrl+C and upon those key combos raises INT 23h.
The proposal is to replace inline assembly for AH=7/INT 21h with a keypress function that does the same thing.
Put this probably into USERINT1.C:
Making this one fuction has an additional benefit that one could more easily place an
#ifdef __COMPILER__
here for a compiler doesn't support intdos() or uses a different syntax. Also, the function could be easily edited to allow yielding.The effect of this change would be to remove some of the inline assembly code in an effort to make the code a little more portable. Since, Watcom C uses a different inline assembly syntax.
If the 1.3.1 BETA is to be merged or not, this code should be done after that decision.
Sources: http://spike.scu.edu.au/~barry/interrupts.html#ah07 https://dos4gw.org/08h_8_Console_Character_Input_without_Echo