home *** CD-ROM | disk | FTP | other *** search
/ Power-Programmierung / CD2.mdf / c / library / dos / grafik / cbgi111 / src / lib / d_instal.asm < prev    next >
Encoding:
Assembly Source File  |  1990-06-15  |  1.6 KB  |  57 lines

  1. ideal            ; Set up in ideal mode
  2. model    tiny        ; This is done in tiny model
  3.  
  4. ;******************* dispatch_install ************************************
  5. ;  Interfaces BGI driver code to the calling interface.  Save old DS and 
  6. ;     sets up a new one for the driver to use.  Restores the old DS and
  7. ;     does a far return on exit.  It passes and returns the parameters in
  8. ;     the conventional 'C' fashion.  This makes it much easier to write
  9. ;     the main driver in C and let the compiler optimize to its hearts 
  10. ;     content.
  11. ;
  12. ;        INPUT:    al    -- Install mode.
  13. ;            cx    -- Mode number.
  14. ;
  15. ;        OUTPUT:    cx    -- Number of modes.
  16. ;            bx    -- Stat block /name address.
  17. ;            es    -- Data segment.
  18. ;
  19. ;    V 1.00 28/06/89  Robert Adsett.
  20. ;    V 1.01 15/06/90  Robert Adsett.  Eliminate DOSSEG ordering.
  21. ;
  22. ;  (C) Robert Adsett 1989,1990
  23. ;*************************************************************************
  24.  
  25. codeseg            ; Start of the code segment
  26.  
  27. ;*************************************************************************
  28. ;    Declare publics and externals.
  29. ;*************************************************************************
  30.  
  31. extrn    _install    : near        ;external function, does actual 
  32.                     ;  work.
  33. public    dispatch_install        ;make this routine public so it
  34.                     ;  can be hooked.
  35.  
  36.  
  37. proc dispatch_install  near
  38.  
  39.     xor    ah,ah
  40.     push    ax            ;Install mode.
  41.     push    cx            ;Mode number.
  42.     call    _install        ;call 'C' driver
  43.     add    sp,4            ;Clean up stack.
  44.     mov    bx,ax            ;Possible address to return.
  45.     mov    cx,dx            ;Possible number to return.
  46.     push    cs
  47.     pop    es            ;Data segment.
  48.     ret                ;return to caller
  49.  
  50. endp
  51.  
  52. ends
  53. end
  54.  
  55.  
  56. 
  57.