home *** CD-ROM | disk | FTP | other *** search
/ ProfitPress Mega CDROM2 …eeware (MSDOS)(1992)(Eng) / ProfitPress-MegaCDROM2.B6I / UTILITY / SCREEN / VIDMODE.ZIP / 25.ASM next >
Encoding:
Assembly Source File  |  1990-08-11  |  1.7 KB  |  58 lines

  1. title
  2.  
  3. code    segment
  4.         assume          cs:code,ds:code
  5.  
  6.         org     100h
  7.  
  8. begin:
  9.         mov     ax,500h         ;Set the active page to 0.
  10.         int     10h
  11.  
  12.         mov     ax,1200h        ;Request ega information.
  13.         mov     bl,10h
  14.         xor     cx,cx           ;CX will contain info if ega.
  15.         int     10h
  16.  
  17.         or      cx,cx           ;cx will not be 0 if ega is present.
  18.         jz      done            ;ega not present.
  19.  
  20.         mov     bl,30h          ;Select scan lines for alphanumeric modes.
  21.         mov     ax,1202h        ;Set 400 scan lines.
  22.         int     10h
  23.  
  24.         mov     ax,7            ;Assume monochrome.
  25.         or      bh,bh           ;Monochrome color bh == 0 if color.
  26.         jnz     label_1
  27.         mov     al,3            ;80 X 25 color text.
  28.  
  29. label_1:
  30.         int     10h             ;Set the mode.
  31.  
  32. ;Next find the attribute to use for clearing the screen.
  33.         mov     dl,' '          ;Write out a byte
  34.         mov     ah,2            ;using DOS
  35.         int     21h
  36.  
  37.         mov     al,8            ;Now backspace
  38.         mov     ah,14           ;Using BIOS call
  39.         xor     bh,bh           ;Page number 0.
  40.         int     10h
  41.  
  42.         mov     ah,8            ;Read character & attribute
  43.         int     10h             ;using BIOS call (bh = pg)
  44.         mov     bh,ah           ;And save attribute to clear screen.
  45.  
  46.         xor     cx,cx           ;Top row and column == 0, 0
  47.         mov     ax,600h         ;Clear screen.
  48.         mov     dx,(49 shl 8) + 79
  49.         int     10h             ;Clear from top to bottom.
  50.  
  51. done:
  52.         mov     ax,4c00h
  53.         int     21h             ;Program terminate.
  54.  
  55. code    ends
  56.         end        begin
  57.  
  58.