home *** CD-ROM | disk | FTP | other *** search
/ Compu-Fix / Compu-Fix.iso / misc / fonts / asm_demo.asm next >
Encoding:
Assembly Source File  |  1993-03-01  |  2.9 KB  |  73 lines

  1. ;------------------------------------------------------------
  2. ; Sample assembly file.
  3. ;------------------------------------------------------------
  4.  
  5. ;---------------------------------------------------------------------------
  6. ;   Font is saved in the file named DEMO.ASM.  To use the font, you must call
  7. ;   interrupt 10h, function 11h, sub-function 10h to load up the font.
  8. ;   
  9. ;   The following are the parameters needed to call the function:
  10. ;  
  11. ;                 AX  =  1110H      (ah = 11H, al = 10H)
  12. ;          BH  =  bytes per character 
  13. ;          BL  =  block to load to.  (use 0)
  14. ;          CX  =  number of character defined by table
  15. ;          DX  =  starting character value
  16. ;          ES  =  segment of the table (use Seg())
  17. ;          BP  =  offset of the table (use Ofs())
  18. ;
  19. ;   Notice: The character should always be loaded immediately after setting
  20. ;           the Video mode.  If it is not called immediately after the video 
  21. ;           mode is set, some side effects may occur.  We have experienced 
  22. ;           some palette errors when this function is called without setting
  23. ;        the video mode.  The appearance of this effect is intermittent and
  24. ;           unpredictable, but it may be avoided by following the recommend-
  25. ;        ation in this paragraph.
  26. ;   
  27. ;   FONT MANIA will supply you with the height of the font.  It is defined
  28. ;   by your label name with "_POINTS" added at the end of the string.  For
  29. ;   example, if your label reference is called DEMO, then DEMO_POINTS will 
  30. ;   represent the bytes-per-character of the font (the height of the font).
  31. ;   
  32. ;   Set the CX to 256 if you want to load the whole font. If you want to 
  33. ;   load only part of font,  Set CX to the number of the character you want
  34. ;   to load, and set DX to the first character you want to load.
  35. ;   
  36. ;   For example, suppose you want to load characters 65 to 88 (A to Z) and
  37. ;   the label reference is DEMO.  Here are the parameters needed:
  38. ;   
  39. ;         AX  =  1110h
  40. ;         BH  =  DEMO_POINTS
  41. ;         BL  =  0
  42. ;         CX  =  24               ( 24 characters to load )
  43. ;         DX  =  65               ( first character to load )
  44. ;         ES  =  SEGMENT DEMO
  45. ;         BP  =  OFFSET DEMO
  46. ;         
  47. ;   See below for examples of how to set the registers. 
  48. ;----------------------------------------------------------------------------         
  49.  
  50. code    segment    para
  51.     org    100h
  52.  
  53. start:
  54.     mov    ax, 3            ; set the SCREEN MODE first
  55.     int    10h
  56.  
  57.     mov    ax, 1110h        ; use USER's FONT load function
  58.     mov    bh, DEMO_POINTS        ; get the bytes per character in bh
  59.                     ; FONT MANIA will provided the font
  60.                     ; height.  LABEL_POINTS.
  61.     xor    bl, bl            ; load to character block 0
  62.     mov    cx, 256            ; load all 256 characters
  63.     xor    dx, dx            ; begin with character 0 (ascii NULL)
  64.     mov    bp, offset DEMO        ; address of the font.  LABEL
  65.     int    10h            ; load it
  66.     
  67.     int    20h            ; terminate the program
  68.  
  69. include    demo.asm            ; the font data.
  70.  
  71. code    ends
  72.  
  73.     end    start            ; end of file / starting point