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

  1.  
  2. ;Pcspace-screen driver Hercules- 256colors
  3. ;
  4. ;To create a herch.drv:
  5. ; tasm herch
  6. ; tlink herch
  7. ; exe2bin herch
  8. ; ren herch.bin herch.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 255 ;number of colors-1
  28.        ;Table of parameters for initialization
  29.        db 5dh ;Mode 0: resolution 640*480
  30.        db 5eh ;Mode 1: resolution 800*600
  31.        db 62h ;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 "Hercules SVGA 256colors" ;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: xor   ah,ah
  43.        int   10h
  44.        retf
  45.  
  46.  
  47.      ;set video bank
  48.      ;Used registers: ax,dx,es
  49.  bank: mov   dx,0a000h    ;segmentadr. video memory
  50.        mov   es,dx
  51.  
  52.        mov   ah,al
  53.        push  ax
  54.        mov   dx,03ceh
  55.        mov   al,6
  56.        out   dx,al
  57.  
  58.        inc   dl
  59.        in    al,dx
  60.        dec   dl
  61.        or    al,4
  62.        mov   ah,al
  63.        mov   al,06h
  64.        out   dx,ax
  65.        mov   dl,0c4h
  66.        mov   al,0bh
  67.        out   dx,al
  68.  
  69.        inc   dl
  70.        in    al,dx
  71.        dec   dl
  72.        pop   ax
  73.        xor   ah,2
  74.        mov   al,0eh
  75.        out   dx,ax
  76.        retf
  77.  
  78.  
  79. start  endp
  80.  
  81. prog  ends
  82.  
  83.  end  start