home *** CD-ROM | disk | FTP | other *** search
/ QBasic & Borland Pascal & C / Delphi5.iso / C / Samples / C-ASM_VI.ARJ / PROGASM.ZIP / PROG012.ASM < prev    next >
Encoding:
Assembly Source File  |  1988-04-10  |  1.2 KB  |  30 lines

  1.  
  2. ;************************************************************************
  3. ; Setup text mode with more addressable columns (80 visible)            *
  4. ; Entry:        [BP+4] - Number of columns to use (80 - 255)            *
  5. ;************************************************************************
  6.  
  7.         PUBLIC  _Set_More_Columns
  8.  
  9. _Set_More_Columns  PROC    NEAR
  10.         PUSH    BP                      ;Standard entry from C call
  11.         MOV     BP,SP
  12.         PUSH    ES
  13.  
  14.         XOR     AX,AX                   ;Get address of CRT controller
  15.         MOV     ES,AX                   ;From segment 0
  16.         MOV     DX,ES:[BIOS_CRT_Addr]
  17.         MOV     AL,13H                  ;Index for OFFSET register
  18.         OUT     DX,AL                   ;Select index
  19.         INC     DX
  20.         MOV     AX,[BP+4]               ;Fetch new text line width
  21.         MOV     ES:[BIOS_Columns],AX    ;Let BIOS know about new width
  22.         SHR     AL,1                    ;Divide by 2 for OFFSET regiser
  23.         OUT     DX,AL                   ;Set OFFSET register
  24.  
  25.         POP     ES                      ;Standard return to C
  26.         MOV     SP,BP
  27.         POP     BP
  28.         RET
  29. _Set_More_Columns ENDP
  30.