home *** CD-ROM | disk | FTP | other *** search
/ C!T ROM 2 / ctrom_ii_b.zip / ctrom_ii_b / C!T / C!T01_94 / CAPSLOCK / CAPSLOCK.ASM next >
Assembly Source File  |  1993-12-27  |  2KB  |  100 lines

  1.  
  2.  ;----------------------------------------------------
  3.  ; CapsLock.asm : controleert of de Caps Lock + toets
  4.  ; i.p.v. de linker-Shift + toets is ingedrukt.
  5.  ;
  6.  ; assembler:
  7.  ; TASM : tasm capslock tot capslock.obj
  8.  ;        tlink /t capslock tot capslock.com
  9.  ; A86  : a86 capslock.asm tot capslock.com
  10.  ; MASM : masm capslock tot capslock.obj
  11.  ;        link capslock tot capslock.exe
  12.  ;        exe2bin capslock tot capslock.com
  13.  ;----------------------------------------------------
  14.  ; constanten
  15.  
  16.     false    equ 0
  17.     true     equ 1
  18.     capslock equ 58
  19.  
  20.  ;----------------------------------------------------
  21.  ; programma
  22.  ;----------------------------------------------------
  23.  
  24.   CODE SEGMENT
  25.  
  26.   ASSUME  cs:CODE, ds:CODE, es:CODE
  27.   ORG 100h
  28.  
  29.   main:
  30.     jmp begin
  31.  
  32.  ;----------------------------------------------------
  33.  ; variabelen
  34.  ;----------------------------------------------------
  35.  
  36.     Nolock       db  0
  37.     OldInt09Ofs  dw  ?
  38.     OldInt09Seg  dw  ?
  39.  
  40.  ;----------------------------------------------------
  41.  ; interruptroutine
  42.  ;----------------------------------------------------
  43.  
  44.   NewInt09h PROC
  45.     pushf
  46.     push ax
  47.      push ds
  48.     xor  ax,ax
  49.     mov  ds,ax
  50.     cmp  cs:Nolock,false
  51.     jz   @@1
  52.  
  53.     mov  al,ds:[418h]
  54.     test al,1000000b
  55.     jnz  @@1
  56.     mov  al,1000000b
  57.     xor  ds:[417h],al
  58.     mov  cs:Nolock,false
  59.     jmp  short @@2
  60.  
  61.   @@1:  in   al,60h
  62.     cmp  al,128
  63.     jae  @@2
  64.     cmp  al,capslock
  65.     jz   @@2
  66.     mov  al,ds:[418h]
  67.     test al,1000000b
  68.     jz   @@2
  69.     mov  cs:Nolock,true
  70.  
  71.   @@2:  pop  ds
  72.     pop  ax
  73.     popf
  74.     jmp  dword ptr cs:OldInt09Ofs
  75.  
  76.   NewInt09h ENDP
  77.  
  78.  ;----------------------------------------------------
  79.  ; installatieprogramma
  80.  ;----------------------------------------------------
  81.  
  82.   begin:
  83.     cli
  84.     mov  ax,3509h
  85.     int  21h
  86.     mov  word ptr OldInt09Ofs,bx
  87.     mov  word ptr OldInt09Seg,es
  88.  
  89.     mov  dx,offset NewInt09h
  90.     mov  ax,2509h
  91.     int  21h
  92.     sti
  93.  
  94.     mov  dx,offset begin
  95.     int  27h
  96.  
  97.   CODE  ENDS
  98.  
  99.     END  main
  100.