SHARE
TWEET

Untitled

a guest Sep 16th, 2019 79 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. #include <stdio.h>
  2. #include <conio.h>
  3. #include <dos.h>
  4. #include <stdlib.h>
  5.  
  6. int main(){
  7.     clrscr();
  8.     union REGS rg,reg;
  9.     for(;;){
  10.         asm mov ah,0x00
  11.         asm int 0x16
  12.         asm mov reg,ax
  13.  
  14.         asm mov ah,0x02
  15.         asm int 0x16
  16.         asm mov rg,ax
  17.         if(rg.h.al==32){
  18.             if(rg.h.al==2 || rg.h.al==1 || rg.h.al==64)
  19.                 printf("%c ",reg.h.al);
  20.             else printf("Numlock pressed \n");
  21.         } else {
  22.             printf("%c ",reg.h.al);
  23.         }
  24.         if(reg.h.ah==1)
  25.         break;
  26.         }
  27.     return 0;
  28. }
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top