home *** CD-ROM | disk | FTP | other *** search
/ QBasic & Borland Pascal & C / Delphi5.iso / C / Samples / C-ASM_VI.ARJ / PROGASM.ZIP / PROG066P.ASM < prev    next >
Encoding:
Assembly Source File  |  1988-05-26  |  1.7 KB  |  64 lines

  1.  
  2. ;************************************************************************
  3. ; Select 43 line text mode. It is assumed that an 8x8 character        *
  4. ; generator has been already downloaded                 *
  5. ; This is an example how to set control registers for different     *
  6. ; character heights.                            *
  7. ;************************************************************************
  8.  
  9. CHAR_HITE    EQU    8
  10.  
  11.     PUBLIC    Set_43_Lines
  12.  
  13. Set_43_Lines    PROC    FAR
  14.     PUSH    ES
  15.     XOR    AX,AX            ;Point ES to segment zero
  16.     MOV    ES,AX
  17.  
  18.     ; Set underline location in CRTC 14 to 8
  19.  
  20.     MOV    DX,ES:[BIOS_CRT_Addr]    ;Fetch address of CRT controller
  21.     MOV    AL,14H            ;Index for UNDERLINE LOCATION
  22.     OUT    DX,AL            ;Select UNDERLINE REGISTER
  23.     INC    DX
  24.     MOV    AL,CHAR_HITE        ;Fetch value for underline
  25.     OUT    DX,AL            ;Set UNDERLINE register
  26.     DEC    DX
  27.  
  28.     ; Set character height in CRTC 9 to 7
  29.  
  30.     MOV    AL,9            ;Index for CHARACTER HEIGHT
  31.     OUT    DX,AL            ;Select register for write
  32.     INC    DX
  33.     MOV    AL,CHAR_HITE-1        ;Value is 7
  34.     OUT    DX,AL            ;Write value into register
  35.     DEC    DX
  36.  
  37.     ; Set vertical display end in CRTC 12 to 43*8-1
  38.     ; (upper bit in overflow already set)
  39.  
  40.     MOV    AL,12H            ;Select index
  41.     OUT    DX,AL
  42.     INC    DX
  43. ;    MOV    AL,(43*8-1-256)     ;Write value
  44.     MOV    AL,((350/CHAR_HITE)*CHAR_HITE-1-256)
  45.     OUT    DX,AL
  46.  
  47.     ; Reset constants in segment zero to reflect new dimensions
  48.  
  49.     MOV    BYTE PTR ES:[BIOS_Rows],(350/CHAR_HITE)-1
  50.     MOV    WORD PTR ES:[BIOS_Columns],80
  51.     MOV    WORD PTR ES:[BIOS_Height],CHAR_HITE
  52.  
  53.     ; We are forced here to use BIOS function to put 8x8 character
  54.     ; set into plane 2 (since we do not have our own char set)
  55.  
  56.     MOV    AX,1112H        ;Function = Load 8x8 character set
  57.     MOV    BL,0            ;        into first block
  58.     INT    10H            ;Ask BIOS to use its ROM set
  59.  
  60.  
  61.     POP    ES
  62.     RET
  63. Set_43_Lines    ENDP
  64.