home *** CD-ROM | disk | FTP | other *** search
/ Shareware Compilation 6 / SharewareCD_06.zip / pcspace / video7l.asm < prev    next >
Assembly Source File  |  1993-10-05  |  2KB  |  103 lines

  1.  
  2. ;Pcspace-screen driver VIDEO7- 16colors  (untested)
  3. ;
  4. ;To create a video7l.drv:
  5. ; tasm video7l
  6. ; tlink video7l
  7. ; exe2bin video7l
  8. ; ren video7l.bin video7l.drv
  9. ;
  10. ; Attention: Maximum length of the drv file: 256 Bytes
  11.  
  12. prog  segment para 'code'
  13.  assume cs:prog
  14.  assume ds:prog
  15.  assume ss:prog
  16.  assume es:prog
  17.  
  18. start  proc  far
  19.        ; Initialize entry point for video mode
  20.        jmp short init
  21.  
  22.        ; Set the entry point 64k bank and set the segment address to es
  23.        ; The bank number has been set in al.
  24.        jmp short bank
  25.  
  26.      ;parameter for the driver
  27.        db 15 ;number of colors-1
  28.        ;Table of parameters for initialization
  29.        db 12h ;Mode 0: resolution 640*480
  30.        db 62h ;Mode 1: resolution 800*600
  31.        db 65h ;Mode 2: resolution 1024*768
  32.        db -1  ;Mode 3: resolution 1280*960 (no such resolution)
  33.        db -1  ;Mode 4: resolution 1280*1024 (no such resolution)
  34.  
  35.        db "Video7 16colors" ;Identification text for SETUP
  36.        db 0                  ;length can be adjustable
  37.  
  38.      ;Initialize video mode
  39.      ;Used registers: ax,bx
  40.      ;al has been set to the value of the parameter table
  41.      ;No such resolution (Par.-1) has been captured already.
  42.  init: cmp   al,12h
  43.        jne   v7md
  44.        xor   ah,ah
  45.        int   10h
  46.        retf
  47.   v7md:mov   bl,al
  48.        xor   bh,bh
  49.        mov   ax,6f05h
  50.        int   10h
  51.        retf
  52.  
  53.  
  54.      ;set video bank
  55.      ;Used registers: ax,dx,es
  56.  bank: mov   dx,0a000h       ;segmentadr. video memory
  57.        mov   es,dx
  58.  
  59.        push  bx
  60.        mov   bl,al
  61.        mov   dx,03c4h
  62.        mov   al,0f9h
  63.        out   dx,al
  64.        inc   dx
  65.  
  66.        mov   al,bl
  67.        and   al,01h
  68.        out   dx,al
  69.  
  70.        mov   dl,0cch
  71.        in    al,dx
  72.        and   al,0dfh
  73.        mov   ah,bl
  74.        and   ah,02h
  75.        shl   ah,4
  76.  
  77.        or    al,ah
  78.        mov   dl,0c2h
  79.        out   dx,al
  80.        mov   dl,0c4h
  81.        mov   al,0f6h
  82.        out   dx,al
  83.  
  84.        inc   dx
  85.        in    al,dx
  86.        and   al,0f0h
  87.        mov   ah,bl
  88.        shr   ah,2
  89.  
  90.        mov   bh,bl
  91.        and   bh,4
  92.        or    ah,bh
  93.        or    al,ah
  94.        out   dx,al
  95.        pop   bx
  96.        retf
  97.  
  98.  
  99. start  endp
  100.  
  101. prog  ends
  102.  
  103.  end  start