NASM - The Netwide Assembler

NASM Forum => Programming with NASM => Topic started by: T145 on December 02, 2019, 12:22:00 PM

Title: How is Ctrl-Break implemented in 16-bit NASM?
Post by: T145 on December 02, 2019, 12:22:00 PM
I found mention of interrupt 1B (http://www.stanislavs.org/helppc/int_1b.html), but am unsure how to actually implement it.
Title: Re: How is Ctrl-Break implemented in 16-bit NASM?
Post by: debs3759 on December 02, 2019, 10:50:54 PM
Are you trying to read the keyboard or insert it into a piece of code? What OS are you coding for? Have you got any code that you have tried which you can post? With a bit more info, someone may be able to answer.

It's a long time since I tried reading keyboard scan codes, and the language your OS is set to use may also affect it (although I thenk that combination is the same globally). I will see if I can find my keyboard coding examples over the next few days.
Title: Re: How is Ctrl-Break implemented in 16-bit NASM?
Post by: T145 on December 03, 2019, 05:06:44 AM
Are you trying to read the keyboard or insert it into a piece of code?
My intent is to detect Ctrl-Break and essentially just call exit.

What OS are you coding for?
NASM Win16 against DOSBOX

Have you got any code that you have tried which you can post?
No, hence why it was stated that I "am unsure how to actually implement it."
Title: Re: How is Ctrl-Break implemented in 16-bit NASM?
Post by: debs3759 on December 05, 2019, 02:44:03 PM
According to https://www.win.tue.nl/~aeb/linux/kbd/scancodes-1.html the scan code is E0 46.

https://stackoverflow.com/questions/24988886/scan-the-keyboard-to-obtain-scan-codes has an example of how to capture / read scan codes in x86 code.

I hope that provides a useful starting point.