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

  1. ideal            ; Set up in ideal mode
  2. model    tiny        ; This is done in tiny model
  3.  
  4. ;******************* dispatch_restorebitmap ******************************
  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:    ax    -- x1
  13. ;            bx    -- y1.  (x1, y1) describe one corner of a 
  14. ;                     rectangle to restore.
  15. ;            cx    -- x2
  16. ;            dx    -- y2.  (x2, y2) describe the other corner.
  17. ;            es    -- segment of data to restore.
  18. ;            bx    -- offset of data to restore.
  19. ;            al    -- write mode during restore.
  20. ;
  21. ;        OUTPUT:    none
  22. ;
  23. ;    V 1.00 12/07/89  Robert Adsett.
  24. ;    V 1.01 15/06/90  Robert Adsett.  Eliminate DOSSEG ordering.
  25. ;
  26. ;  (C) Robert Adsett 1989,1990
  27. ;*************************************************************************
  28.  
  29. codeseg            ; Start of the code segment
  30.  
  31. ;*************************************************************************
  32. ;    Declare publics and externals.
  33. ;*************************************************************************
  34.  
  35. extrn    _restorebitmap    : near        ;external function, does actual 
  36.                     ;  work.
  37. public    dispatch_restorebitmap        ;make this routine public so it
  38.                     ;  can be hooked.
  39.  
  40.  
  41. proc dispatch_restorebitmap  near
  42.  
  43.     push    dx            ;y2
  44.     push    cx            ;x2
  45.     push    di            ;y1
  46.     push    si            ;x1
  47.     push    bx            ;offset
  48.     push    es            ;segment
  49.     xor    ah,ah            ;don't let garbage in ah foul things
  50.                     ;up
  51.     push    ax            ;write mode
  52.     call    _restorebitmap        ;call 'C' driver
  53.     add    sp,14            ;restore stack
  54.     ret                ;return to caller
  55.  
  56. endp
  57.  
  58. ends
  59. end
  60. 
  61.