home *** CD-ROM | disk | FTP | other *** search
/ PC Underground / UNDERGROUND.ISO / trainer / raidtrai.asm < prev    next >
Assembly Source File  |  1995-08-07  |  3KB  |  128 lines

  1. ;                **************************************
  2. ;                ***                                ***
  3. ;                ***   Trainer for   R A I D E R S   ***
  4. ;                ***                                ***
  5. ;                ***   (c) 1994 by DATA Becker      ***
  6. ;                ***                                ***
  7. ;                ***   Author: Boris Bertelsons      ***
  8. ;                ***                                ***
  9. ;                **************************************
  10. ;
  11. ;
  12.  
  13. .286
  14. jumps
  15.   w equ word ptr
  16.   b equ byte ptr
  17. code segment public
  18. public insthand
  19. public handler9
  20. public reslim
  21. public oldint9
  22. public id
  23. public idlen
  24. public check_inst
  25.  
  26. assume cs:code,ds:code
  27. id:  db 'Trainer for DATA BECKER/ABACUS  by  InspirE / TC'
  28. oldint9: dd 0
  29. procedure: dd ?
  30. idlen equ offset oldint9 - offset id
  31.  
  32.  
  33. ;  *********************************************************************
  34. ;  ***                                                               ***
  35. ;  ***  From this point on you'll find the actual trainer routines   ***
  36. ;  ***                                                               ***
  37. ;  *********************************************************************
  38.  
  39. ;  *********************************************************************
  40. ;  ***                                                               ***
  41. ;  ***  The new INT 9h.  the procedure checks whether a key of the   ***
  42. ;  ***  trainer was pressed and may change variables                 ***
  43. ;  ***                                                               ***
  44. ;  ***                                                               ***
  45. ;  *********************************************************************
  46. handler9 proc pascal
  47.   pushf
  48.   push bp
  49.   push ds
  50.   push bx
  51.  
  52.   in  al,60h       ; Read character
  53.  
  54.   cmp al,59        ; F1 key
  55.   je  Game_over
  56.   cmp al,63        ; F5 key
  57.   je  Full_life
  58.   cmp al,64        ; F7 key
  59.   je  Add_points
  60.   jmp end_keyb
  61.  
  62. End_regulaer:
  63.  
  64. End_keyb:
  65.   pop  bx
  66.   pop  ds
  67.   pop  bp
  68.   popf
  69.   jmp dword ptr cs:oldint9       ; Call old int 9h
  70.  
  71. Game_over:
  72.   pushf
  73.   pusha
  74.   ; Adjust to your needs !!
  75.   mov ds:byte ptr [0648h],1
  76.   popa
  77.   popf
  78.   jmp End_regulaer
  79.  
  80. Full_life:
  81.   pushf
  82.   pusha
  83.   ; Adjust to your requirements !!
  84.   mov ds:byte ptr [0648h],255
  85.   POPA
  86.   popf
  87.   jmp End_regulaer
  88.  
  89. Add_points:
  90.   pushf
  91.   pusha
  92.   ; Adjust to your requirements !!
  93.   mov bx,ds:word ptr [064Ah]
  94.   add bx,1000d
  95.   mov ds:word ptr [064Ah],bx
  96.   POPA
  97.   popf
  98.   jmp End_regulaer
  99.  
  100. handler9 endp
  101. insthand proc pascal
  102. reslim label byte
  103.   push ds
  104.   pop ds
  105.   mov ax,3509h                    ; Backup old INT 21
  106.   int 21h
  107.   mov w oldint9,bx
  108.   mov w oldint9 + 2,es
  109.   mov ax,2509h                    ; Coerce INT 21h to your own routine
  110.   lea dx,handler9
  111.   int 21h
  112.   ret
  113. insthand endp
  114.  
  115. check_inst proc near
  116.   mov ax,3509h                    ; Determine interrupt vector
  117.   int 21h
  118.   mov di,bx
  119.   mov si,offset ID
  120.   mov di,si
  121.   mov cx,idlen
  122.   repe cmpsb                      ; Check characteristic
  123.     ret
  124. check_inst endp
  125.  
  126. code ends
  127. end
  128.