home *** CD-ROM | disk | FTP | other *** search
/ Club Amiga de Montreal - CAM / CAM_CD_1.iso / files / 573b.lha / Turbo2088 / biosext.asm < prev    next >
Assembly Source File  |  1991-06-16  |  3KB  |  94 lines

  1.         NAME    BIOSEXT
  2.         TITLE   BIOSEXT -- Extension to A2088 BIOS
  3.         PAGE    58,132
  4. ;.............................................................................
  5. ;
  6. ;       BIOSEXT extends the BIOS of the A2088 to allow switching the cpu
  7. ;       clock speed from the keyboard. This only works with a FE2010A!
  8. ;
  9. ;       <ctrl>-<alt>-S switches to 4.77 MHz
  10. ;       <ctrl>-<alt>-M switches to 7.15 MHz
  11. ;       <ctrl>-<alt>-F switches to 9.54 MHz
  12. ;
  13. ;       Written by Eddy Olk, 1991. This source is public domain and may be
  14. ;       freely distributed and used for non-commercial purposes.
  15. ;.............................................................................
  16.  
  17.          callcombo = 0CH    ;0CH for Ctrl-Alt,
  18.                             ;06H for Ctrl-Shift,
  19.                             ;0AH for Shift-Alt.
  20.          oldvec = 5CH       ;place to store original INT9 vector.
  21.  
  22. cseg     SEGMENT
  23.          ASSUME cs:cseg, ds:cseg
  24.  
  25.          ORG  100H
  26.  
  27. begin:   jmp  install
  28.  
  29. newint09:push ax
  30.          push ds
  31.          sub  ax,ax
  32.          mov  ds,ax
  33.          mov  al,ds:[417H]               ;get keyboard flag byte
  34.          and  al,0FH
  35.          cmp  al,callcombo
  36.          jne  exit
  37.          in   al,60H                     ;read keyboard
  38.          cmp  al,1FH  ;'S'
  39.          je   slow
  40.          cmp  al,32H  ;'M'
  41.          je   medium
  42.          cmp  al,21H  ;'F'
  43.          je   fast
  44. exit:    pop  ds
  45.          pop  ax
  46.          jmp  dword ptr cs:[oldvec]      ;jump to original keyboard routine
  47. slow:    call reset_keyboard
  48.          mov  al,03H
  49.          out  63H,al
  50.          pop  ds
  51.          pop  ax
  52.          iret
  53. medium:  call reset_keyboard
  54.          mov  al,63H
  55.          out  63H,al
  56.          pop  ds
  57.          pop  ax
  58.          iret
  59. fast:    call reset_keyboard
  60.          mov  al,83H
  61.          out  63H,al
  62.          pop  ds
  63.          pop  ax
  64.          iret
  65.  
  66. reset_keyboard:                          ;code to reset keyboard
  67.          in   al,61H
  68.          mov  ah,al
  69.          or   al,80H
  70.          out  61H,al
  71.          xchg ah,al
  72.          out  61H,al
  73.          mov  al,20H
  74.          out  20H,al
  75.          ret
  76.  
  77. install: mov  ax,3509H                   ;9 is keyboard interrupt
  78.          int  21H                        ;get old int vector
  79.          mov  word ptr ds:[oldvec],bx    ;and save it
  80.          mov  word ptr ds:[oldvec+2],es
  81.          mov  dx,offset newint09
  82.          mov  ax,2509H                   ;set new int vector with ds:dx
  83.          int  21H
  84.          
  85.          mov  es,ds:[002ch]              ;Get environment segment
  86.          mov  ah,49h
  87.          int  21h                        ;Free it
  88.  
  89.          mov  dx,offset install          ;prepare to leave and stay resident
  90.          int  27H
  91.  
  92. cseg     ENDS
  93.          END begin
  94.