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

  1. ideal            ; Set up in ideal mode
  2. model    tiny        ; This is done in tiny model
  3.  
  4. ;******************* dispatch_textstyle **********************************
  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:    ah    -- Font path & direction.
  13. ;            al    -- Font number.
  14. ;            bx    -- Requested X character size.
  15. ;            cx    -- Requested Y character size.
  16. ;
  17. ;        OUTPUT:    bx    -- Actual X character size.
  18. ;            cx    -- Actual Y character size.
  19. ;
  20. ;    V 1.00 26/06/89  Robert Adsett.
  21. ;    V 1.01 15/06/90  Robert Adsett.  Eliminate DOSSEG ordering.
  22. ;
  23. ;  (C) Robert Adsett 1989,1990
  24. ;*************************************************************************
  25.  
  26. codeseg            ; Start of the code segment
  27.  
  28. ;*************************************************************************
  29. ;    Declare publics and externals.
  30. ;*************************************************************************
  31.  
  32. extrn    _textstyle    : near        ;external function, does actual 
  33.                     ;  work.
  34. public    dispatch_textstyle        ;make this routine public so it
  35.                     ;  can be hooked.
  36.  
  37.  
  38. proc dispatch_textstyle  near
  39.  
  40.     push    cx            ;Requested y character size.
  41.     push    bx            ;Requested x character size.
  42.     mov    bl,al            ;save al for later.
  43.     mov    al,ah            
  44.     xor    ah,ah
  45.     push    ax            ;Font path & direction.
  46.     mov    al,bl
  47.     push    ax            ;Font number.
  48.     call    _textstyle        ;call 'C' driver
  49.     add    sp,8            ;restore stack
  50.     mov    bx,dx            ;Actual x character size.
  51.     mov    cx,ax            ;Actual ycharacter size.
  52.     ret                ;return to caller
  53.  
  54. endp
  55.  
  56. ends
  57. end
  58. 
  59.