home *** CD-ROM | disk | FTP | other *** search
/ Simtel MSDOS - Coast to Coast / simteldosarchivecoasttocoast.iso / ega / egasmall.asm < prev    next >
Assembly Source File  |  1994-03-04  |  2KB  |  76 lines

  1. Page    60,132
  2. Title    SMALL -- Load EGA 8x8 font for 25 or 43 line screens.
  3. Subttl    Thomas V. Hoffmann, January 1985
  4.  
  5. ;--This program selects 80x25 alpha color mode (mode 3), loads the
  6. ;  EGA character generator with the 8x8 font, and causer BIOS to
  7. ;  recalculate the video parameters for maximum screen dimentions.
  8. ;
  9. ;  With 350-line displays, this gives 43 lines per screen.
  10. ;  With 200-line displays, this gives 25 lines per screen.
  11. ;
  12. ;  Execute:
  13. ;  MASM SMALL.ASM
  14. ;  LINK SMALL
  15. ;
  16. stack    segment    para stack 'stack'
  17.     dw    64 dup(0)
  18. stack    ends
  19.  
  20. bdata    segment at 40H        ; BIOS data segment
  21.     org    63H
  22. CRTC    dw    ?        ; base I/O address of CRTC
  23.     org    87H
  24. info    db    ?        ; bit 0=1 inhibits cursor emulation
  25. bdata    ends
  26.  
  27. code    segment    para public 'code'
  28. small    proc    far
  29.     push    es        ; push ES:0 for return to DOS
  30.     sub    ax,ax
  31.     push    ax
  32.     mov    ax,bdata    ; set DS to BIOS data segment
  33.     mov    ds,ax
  34.     assume    ds:bdata
  35.     mov    ax,0003H    ; set 80-column alpha mode
  36.     int    10H
  37.     mov    ax,1112H    ; load 8x8 font
  38.     mov    bl,0        ;   into block 0
  39.     int    10H        ;   and recalc screen
  40.  
  41. ;  This code sets the EGA CRTC cursor register directly, after
  42. ;  inhibiting the BIOS cursor emulation function. On 350-line
  43. ;  displays, this prevents BIOS from setting the cursor to lines
  44. ;  11 and 12, which are not displayed for 8 line characters.
  45.  
  46.     or    info,1        ; inhibit cursor emulation
  47.     mov    ax,0100H    ; set cursor
  48.     mov    bh,0        ;   for page 0
  49.     mov    cx,0600H    ;   to last two lines
  50.     int    10H        ;   (start on 6, off on 0)
  51. page
  52.  
  53. ;  This code sets the underline location register in the CRTC to
  54. ;  the last line of the character box (line 7). BIOS incorrectly
  55. ;  sets it to line 8, which is not displayed.
  56.  
  57.     mov    dx,CRTC        ; get CRTC base address
  58.     mov    al,14H        ; select underline loc register
  59.     out    dx,al
  60.     inc    dx        ; point DX to CRTC data register
  61.     mov    al,7        ; set underline location to line 7
  62.     out    dx,al
  63.  
  64. ;  This code enables the EGA BIOS print screen routine, which
  65. ;  can handle non-standard display dimentions. In this case
  66. ;  it handles 43 lines of characters on 350-line displays.
  67.  
  68.     mov    ax,1200H    ; select EGA screen print
  69.     mov    bl,20H        ;    routine
  70.     int    10H
  71.  
  72.     ret            ; return to DOS
  73. small    endp
  74. code    ends
  75.     end    small        ; label needed for linker [M. Papa]
  76.