home *** CD-ROM | disk | FTP | other *** search
/ PC Interdit / pc-interdit.iso / trainer / tr_raid.asm < prev    next >
Assembly Source File  |  1994-10-19  |  3KB  |  138 lines

  1. ;                **************************************
  2. ;                ***                                ***
  3. ;                ***   Entraîneur pour R A I D E R  ***
  4. ;                ***                                ***
  5. ;                ***  (c) 1994 by MICRO Application ***
  6. ;                ***                                ***
  7. ;                ***   Auteur: 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 signature
  23. public siglong
  24. public check_inst
  25.  
  26. assume cs:code,ds:code
  27. signature:  db 'Entraîneur pour MICRO APPLICATION  par  InspirE / TC'
  28. oldint9: dd 0
  29. procedure: dd ?
  30. siglong equ offset oldint9 - offset signature
  31.  
  32.  
  33. ;  *********************************************************************
  34. ;  ***                                                               ***
  35. ;  ***  Ici commencent les routines proprement dites de l'entraîneur ***
  36. ;  ***                                                               ***
  37. ;  *********************************************************************
  38.  
  39. ;  **********************************************************************
  40. ;  ***                                                                ***
  41. ;  ***  Nouvelle interruption 9h. La procédure teste si une touche a  ***
  42. ;  ***  a été tapée et modifie des variables le cas échéant           ***
  43. ;  ***                                                                ***
  44. ;  **********************************************************************
  45. handler9 proc pascal
  46.   pushf
  47.   push bp
  48.   push ds
  49.   push bx
  50.  
  51.   in  al,60h                    ; lit un caractère
  52.  
  53.   cmp al,59                     ; touche F1
  54.   je  Game_over
  55.   cmp al,63                     ; touche F5
  56.   je  Longue_vie
  57.   cmp al,64                     ; touche F7
  58.   je  Add_Points
  59.   jmp fin_keyb
  60.  
  61. Fin_reguliere:
  62. Fin_keyb:
  63.   pop  bx
  64.   pop  ds
  65.   pop  bp
  66.   popf
  67.   jmp dword ptr cs:oldint9       ; appelle l'ancienne int 9h
  68.  
  69. Game_over:
  70.   pushf
  71.   PUSHA
  72.   ; A adapter à vos besoins!!
  73.  
  74.   mov ds:byte ptr [0648h],1
  75.  
  76.   POPA
  77.   popf
  78.   jmp fin_reguliere
  79.  
  80.  
  81.  
  82. Longue_vie:
  83.   pushf
  84.   PUSHA
  85.   ; A adapter à vos besoins !!
  86.  
  87.   mov ds:byte ptr [0648h],255
  88.  
  89.   POPA
  90.   popf
  91.   jmp fin_reguliere
  92.  
  93.  
  94.  
  95. Add_Points:
  96.   pushf
  97.   PUSHA
  98.   ; A adapter à vos besoins!!
  99.  
  100.   mov bx,ds:word ptr [064Ah]
  101.   add bx,1000d
  102.   mov ds:word ptr [064Ah],bx
  103.   POPA
  104.   popf
  105.   jmp fin_reguliere
  106.  
  107. handler9 endp
  108.  
  109.  
  110. insthand proc pascal
  111. reslim label byte
  112.     push ds
  113.   pop ds
  114.     mov ax,3509h            ; sauve l'ancienne INT 21
  115.   int 21h
  116.   mov w oldint9,bx
  117.   mov w oldint9 + 2,es
  118.   mov ax,2509h                  ; détourne l'INT 21h
  119.   lea dx,handler9
  120.   int 21h
  121.     ret
  122. insthand endp
  123.  
  124. check_inst proc near
  125.   mov ax,3509h                  ; lit le vecteur d'interruption
  126.   int 21h
  127.   mov di,bx
  128.   mov si,offset signature
  129.   mov di,si
  130.   mov cx,siglong
  131.   repe cmpsb                    ; teste la signature
  132.     ret
  133. check_inst endp
  134.  
  135. code ends
  136. end
  137.  
  138.