0D1C is Little-Endian for 0x1C0D = Enter. So in the 'output' I gave their should be at least 4 of them in the BIOS (CIRCULAR) Keyboard Buffer.
Even entries from the MS-DOS command-line are preserved; apparently Grub4Dos didn't 'clean' the BIOS Keyboard Buffer (I tried with Fn.24 0x41E 0x00 0x20: in LimboX86 possible, but in Vbox a big crash...).
If I start everything from batches without textual input in between (so starting INT16AH4.G4B from MENU.LST I get:
00000400: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 C0 9F ; ................
00000410: 6F 00 00 7F 02 00 00 00 00 00 24 00 26 00 0D 1C ; o.........$.&...
00000420: 0D 1C 0D 1C 00 48 00 00 00 00 00 00 00 00 00 00 ; .....H..........
00000430: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 02 00 ; ................
But because the History Buffer is empty, nothing happens on the set /p command-line, which make sense. In MS-Dos I have to give Enter twice, and once for choosing my menu in MENU.LST
If I do what you asked for ('output' always below):
Give key scancode in hex > 0x4800
Give number (Enter=1) > 1
Gives '1' on my set /p command-line
00000400: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 C0 9F ; ................
00000410: 6F 00 00 7F 02 00 00 00 00 00 36 00 38 00 0D 1C ; o.........6.8...
00000420: 0D 1C 0D 1C 30 0B 78 2D 34 05 38 09 30 0B 30 0B ; ....0.x-4.8.0.0.
00000430: 0D 1C 31 02 0D 1C 00 48 00 00 00 00 00 00 02 00 ; ..1....H........
Give key scancode in hex > 0x4800
Give number (Enter=1) > 2
Gives '0x4800' on my set /p command-line
00000400: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 C0 9F ; ................
00000410: 6F 00 00 7F 02 00 00 00 00 00 36 00 3A 00 0D 1C ; o.........6.:...
00000420: 0D 1C 0D 1C 30 0B 78 2D 34 05 38 09 30 0B 30 0B ; ....0.x-4.8.0.0.
00000430: 0D 1C 32 03 0D 1C 00 48 00 48 00 00 00 00 02 00 ; ..1....H.H......
Give key scancode in hex > 0x4800
Give number (Enter=1) > 3
Gives '0x4800' on my set /p command-line (only two entries in History Buffer!)
00000400: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 C0 9F ; ................
00000410: 6F 00 00 7F 02 00 00 00 00 00 36 00 3C 00 0D 1C ; o.........6.<...
00000420: 0D 1C 0D 1C 30 0B 78 2D 34 05 38 09 30 0B 30 0B ; ....0.x-4.8.0.0.
00000430: 0D 1C 33 04 0D 1C 00 48 00 48 00 48 00 00 02 00 ; ..3....H.H.H....
Give key scancode in hex > 0x4800
Give number (Enter=1) > 4
Gives '0x4800' on my set /p command-line (only two entries in History Buffer!)
00000400: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 C0 9F ; ................
00000410: 6F 00 00 7F 02 00 00 00 00 00 36 00 1E 00 0D 1C ; o.........6.....
00000420: 0D 1C 0D 1C 30 0B 78 2D 34 05 38 09 30 0B 30 0B ; ....0.x-4.8.0.0.
00000430: 0D 1C 34 05 0D 1C 00 48 00 48 00 48 00 48 02 00 ; ..4....H.H.H.H..
And one for free:
Give key scancode in hex > 0x4800
How many times? (max 15 - Enter=1) > 5
Gives still '0x4800' on my set /p command-line (only two entries in History Buffer!)
00000400: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 C0 9F ; ................
00000410: 6F 00 00 7F 02 00 00 00 00 00 36 00 20 00 00 48 ; o.........6. ..H
00000420: 0D 1C 0D 1C 30 0B 78 2D 34 05 38 09 30 0B 30 0B ; ....0.x-4.8.0.0.
00000430: 0D 1C 35 06 0D 1C 00 48 00 48 00 48 00 48 02 00 ; ..5....H.H.H.H..
And so on. I hope I made no mistakes, typed everything by hand.
BTW in this case there are no 'Enters' (0D1C) after 0048-ArrowUp's written with INT16\AH=05 (except 'older ones' that are not overwritten yet = last case of '5 times')
BTW2 Start reading from 0x417: Keyboard Status (2 bytes); 0x419: Alt-related (1 byte); 0x41A: Address of Keyboard Buffer Head (2 bytes); 0x41C: Address of Keyboard Buffer Tail (2 bytes); 0x41E: Keyboard Buffer (32 bytes). 0x43E+F are diskette-related.
Edited by deomsh, 23 June 2021 - 02:54 PM.