home *** CD-ROM | disk | FTP | other *** search
- ;
- ;Programm schaltet den Bildschirm dunkel
- ;(für Hercules-Bildschirmadapter)
- ;in die CONFIG.SYS einbinden mit DEVICE=SCR_OFF.SYS
- ;
- ;übersetzen mit tasm scr_off.asm
- ; tlink scr_off
- ; exe2bin scr_off.exe scr_off.sys
- ;
- ;Grundlagen siehe Artikel "Dunkelmacher" in CT 6/87 S. 74
- ;Struktur des SYS-Treibers aus CT 3/90 S. 346
- ;
- ;letzte Änderung am 11.09.91 B. Rosenau
-
- code segment public 'ATCODE'
- atdrive proc far
- assume cs:code,ds:code,es:code
- org 0
- header dd -1 ;Verbindung zum nächsten
- ;Treiber = Ende der Liste
- dw 8000h ;Geräte-Attribut-Wort
- dw strat ;Eintrittspunkt für
- ;Strategie-Routine
- dw intr ;Eintrittspunkt für
- ;Interruptroutine
- db 'SCR_OFF' ;Gerätetreiber-Name
-
- ;
- ; Doppelwort-Pointer zum Anforderungskopf
- ;
- rh_ptr dd ? ;Pointer zum Anforderungskopf
- ;
- ;Tabelle für nicht-standardgemäße Drive-Parameter
- ;
- ;Strategie-Routine des Gerätetreibers
- ;
- strat proc far ;Adresse des Anforderungskopfes
- ;sichern
- mov word ptr cs:[rh_ptr],bx
- mov word ptr cs:[rh_ptr+2],es
- ret
- strat endp
- ;
- ;Interrupt-Routine des Gerätetreibers
- ;
- intr proc far
- push ax ;Sichern der allgemeinen Register
- push bx
- push dx
- push ds
- push es
- push di
- push cs ;Lokale Daten addressierbar machen
- pop ds
- les di,[rh_ptr] ;ES:DI jetzt = Anforderungskopf
- mov bl,es:[di+2] ;setze bx = Befehlscode
- xor bh,bh
- cmp bx,0 ;Initialisierungsbefehl ?
- je init_st
- mov ax,8003h ;Nein --> Fehler
- je init_ed
- init_st:
- call init
- les di,[rh_ptr] ;Anforderungskopf nach ES:DI wiederherstellen
- init_ed:
- or ax,0100h ;Flag im Statuswort auf "erledigt"
- ;setzen
- mov es:[di+3],ax
- pop di
- pop es
- pop ds
- pop dx
- pop bx
- pop ax
- ret ;zurück zu DOS
-
- ;
- ;Initialisierungsroutine
- ;
- init proc near
- push es ;Adresse des Anforderungskopfes
- ;sichern
- push di
- xor ax,ax ;ES auf niedrigsten Speicherbereich
- ;setzen
- mov es,ax
- mov di,1Ch ;Int-Nummer nach DI
- shl di,1 ;Multiplikation mit 4
- shl di,1
-
- ;--------------------------------------------------------------------------
- ; Bildschirm dunkelschalten
-
- push ax
- push dx
- mov dx,3B8h
- mov al,0h
- out dx,al
- pop ax
- pop dx
-
- ;--------------------------------------------------------------------------
-
- pop di ;Adresse des Anführungskopfes
- ;wiederherstellen
- pop es
- ;erste freizugebende Speicherstelle
- ;angeben
- mov word ptr es:[di+14],offset init
- mov word ptr es:[di+16],cs
- xor ax,ax ;Rückkehrstatus setzen
- ret
- init endp
- intr endp
- atdrive endp
- code ends
- end
-