Author Topic: How is Ctrl-Break implemented in 16-bit NASM?  (Read 9844 times)

Offline T145

  • Jr. Member
  • *
  • Posts: 12
  • Country: 00
  • Hacker, Jacker & All-Around Gobsmacker
    • CodeReview
How is Ctrl-Break implemented in 16-bit NASM?
« 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.
« Last Edit: December 02, 2019, 12:23:45 PM by T145 »

Offline debs3759

  • Global Moderator
  • Full Member
  • *****
  • Posts: 224
  • Country: gb
    • GPUZoo
Re: How is Ctrl-Break implemented in 16-bit NASM?
« Reply #1 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.
My graphics card database: www.gpuzoo.com

Offline T145

  • Jr. Member
  • *
  • Posts: 12
  • Country: 00
  • Hacker, Jacker & All-Around Gobsmacker
    • CodeReview
Re: How is Ctrl-Break implemented in 16-bit NASM?
« Reply #2 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."

Offline debs3759

  • Global Moderator
  • Full Member
  • *****
  • Posts: 224
  • Country: gb
    • GPUZoo
Re: How is Ctrl-Break implemented in 16-bit NASM?
« Reply #3 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.
My graphics card database: www.gpuzoo.com