Advertisement
Guest User

Untitled

a guest
Sep 16th, 2019
98
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.46 KB | None | 0 0
  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. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement