home *** CD-ROM | disk | FTP | other *** search
/ The Equalizer BBS / equalizer-bbs-collection_2004.zip / equalizer-bbs-collection / DEMOSCENE-STUFF / IBYTES02.ZIP / SRC_HI!.ZIP / SETVGA.ASM < prev    next >
Assembly Source File  |  1994-08-07  |  1KB  |  99 lines

  1.         ideal
  2.         p386
  3.         model    large,pascal
  4.         codeseg    VGA
  5.  
  6. ; -- set_vga_mode ----------------------------------------------
  7. ;
  8. public        set_vga_mode
  9. proc        set_vga_mode    far
  10.     mov    ax,13h
  11.     int    10h
  12. IF    0
  13.     mov    dx,03C4h
  14.     mov    ax,0604h
  15.     out    dx,ax
  16.     mov    dx,03CEh
  17.     mov    ax,4005h
  18.     out    dx,ax
  19.     mov    al,06h
  20.     out    dx,al
  21.     inc    dx
  22.     in    al,dx
  23.     and    al,0FDh
  24.     out    dx,al
  25.     mov    dx,03D4h
  26.     mov    al,14h
  27.     out    dx,al
  28.     inc    dx
  29.     in    al,dx
  30.     and    al,0BFh
  31.     out    dx,al
  32.     dec    dx
  33.     mov    al,17h
  34.     out    dx,al
  35.     inc    dx
  36.     in    al,dx
  37.     or    al,40h
  38.     out    dx,al
  39. ELSE
  40.     mov    dx,03C4h        ;disable display
  41.     mov    ax,2101h
  42.     out    dx,ax
  43.     mov    ax,0604h
  44.     out    dx,ax
  45.     mov    dx,03D4h
  46.     mov    ax,0014h
  47.     out    dx,ax
  48. ;    mov    ax,4009h
  49. ;    out    dx,ax
  50.     mov    ax,0E317h
  51.     out    dx,ax
  52. ENDIF
  53.     mov    dx,03CEh
  54.     mov    ax,0ff08h
  55.     out    dx,ax
  56.     mov    dx,03C4h
  57.     mov    ax,0f02h
  58.     out    dx,ax
  59.     push    es
  60.     mov    ax,0A000h
  61.     mov    es,ax
  62.     xor    di,di
  63.     mov    ax,di
  64.     mov    cx,8000h
  65.     rep    stosw
  66.     mov    ax,0101h
  67.     out    dx,ax
  68.     pop    es
  69.     ret
  70. endp        set_vga_mode
  71.  
  72. ; -- set_vga_page ----------------------------------------------
  73. ; AL-currpage, ret:AX-seg of next page
  74. public        set_vga_page
  75. proc        set_vga_page    far
  76.     push    dx
  77.     push    ax
  78.     and    al,3
  79.     mov    ah,65536/4/256
  80.     mul    ah
  81.     mov    ah,al
  82.     mov    al,12
  83.     mov    dx,03d4h
  84.     out    dx,ax
  85. ;    mov    ax,000dh
  86. ;    out    dx,ax
  87.     pop    ax
  88.     inc    ax
  89.     and    ax,1    ; Two pages are enough almost for all
  90.     mov    ah,65536/4/256
  91.     mul    ah
  92.     shl    ax,4
  93.     add    ax,0a000h
  94.     pop    dx
  95.     ret
  96. endp        set_vga_page
  97.  
  98.         end
  99.