home *** CD-ROM | disk | FTP | other *** search
- ; ┌─────────────────────────────────┐
- ; │ CGACOLOR.ASM │
- ; ├─────────────────────────────────┤
- ; │ │
- ; │ Ändert die Paletteneinträge │
- ; │ im CGA Modus 320 x 200 │
- ; │ (c) 1990 by R.Seelig & toolbox │
- ; │ │
- ; │ Assembler : │
- ; │ TASM 1.0 oder höher │
- ; │ MASM 4.0 oder höher │
- ; │ A86 3.19 oder höher │
- ; │ Mit EXE2BIN zu COM-File wandeln!│
- ; └─────────────────────────────────┘
- program Segment para 'code'
- assume cs:program
- org 100h
-
- start:
- jmp anfang
-
- dw 80 dup (?) ; eigener Stackspeicher
- newstack:
- aktiv db 0
- cgamode db 0
- altint dd ?
- altss dw ?
- altsp dw ?
-
- egafarbreihe: db 0,9,12,14,0,0,0,0,0,0,0,0,0,0,0,0,0
-
- neuint10:
- pushf
- cmp cs:[aktiv],00h ; TSR Programm bereits aktiv ?
- jz nichtaktiv
- call cs:[altint] ; dann alten Interrupt aufrufen
- iret
- nichtaktiv:
- call cs:[altint] ; alten Interupt aufrufen
- cmp ax,04
- jne keingrinstall
- mov cs:[cgamode],01 ; CGA Grafik wurde installiert
- jmp egafarben ; eigene Palette installieren
- keingrinstall:
- cmp cs:[cgamode],00h
- jnz cga_on
- iret ; Grafikmodus ist nicht gesetzt
- cga_on:
- cmp ax,04
- jnb egafarben
- mov cs:[cgamode],00 ; Textmodus ist gesetzt worden
- iret
- egafarben:
- inc cs:[aktiv]
- cli
- mov cs:altss,ss ; Stack eigenen Speicher geben
- mov cs:altsp,sp
- push cs
- pop ss
- mov sp,offset newstack
- push ax ; saemtliche Register sichern
- push bx
- push cx
- push dx
- push ds
- push es
- push di
- push si
- push cs
- pop ds ; DS = CS
- sti
-
- ; Hier ist das eigentliche seicherresidente Programm
- ; bei Interrupt 10h Funktion 00h und 0BH eigene Farb-
- ; palette installieren
-
- cmp ax,04
- jnz moeg2
- jmp neuefarben
-
- moeg2:
- cmp ah,0bh
- jnz prgend1
-
- neuefarben:
- push ds
- pop es ; ES = DS
- mov dx,offset egafarbreihe
- mov ax,1002h
- int 10h
-
- prgend1:
- pop si
- pop di
- pop es
- pop ds
- pop dx
- pop cx
- pop bx
- pop ax
- dec cs:[aktiv]
- cli
- mov ss,cs:altss
- mov sp,cs:altsp
- sti
- iret
- endetsr:
-
- ; Daten, die nicht resident gemacht werden
- meldung:
- db 13,10,'CGACOLOR Version 1.1 (toolbox 01/91) ist '
- db 'speicherresident installiert !',13,10
- db 13,10,'Standardfarben des 4 Farben'
- db ' CGA Modus werden mit'
- db 13,10,'Farben aus der EGA Palette belegt !',13,10
- db 13,10,'(c) 1990 by R. Seelig & toolbox',13,10,'$'
-
- anfang:
- mov si,offset egafarbreihe
- mov di,si
- mov cx,17
- addschleife:
- lodsb
- cmp al,8
- jb keinadd
- add al,8 ; EGA Farbreihe anpassen
- keinadd:
- stosb
- loop addschleife
- mov dx,offset meldung
- mov ah,09h
- int 21h ; Install - Meldung ausgeben
- mov ah,35h
- mov al,10h
- int 21h ; Interruptvektor holen
- mov word ptr cs:[altint],bx
- mov word ptr cs:[altint+2],es
- push cs
- pop ds ; DS = CS
- mov dx,offset neuint10
- mov ah,25h
- mov al,10h
- int 21h ; neuen Interruptvektor setzen
- lea dx,endetsr ; Laenge des TSR Programms
- int 27h ; speicherresident beenden
- program ends
- end start
- ;***** ENDE CGACOLOR.ASM **********************************
-