home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
The World of Computer Software
/
World_Of_Computer_Software-02-387-Vol-3of3.iso
/
p
/
pchdemo.zip
/
SOURCEFA.ZIP
/
320X200.ASM
< prev
next >
Wrap
Assembly Source File
|
1992-10-28
|
2KB
|
120 lines
code segment public
assume cs:code,ds:code,es:code,ss:stack
extrn digit:near,convert:near
push cs
pop ds
push cs
pop es
mov di,offset tab1 ; Erstellen der Palette mit 256 Farben
mov ax,0
mov bl,0
s0:
stosw
mov [di],bl
inc di
add bl,21
cmp bl,64
jb s0
mov bl,0
add ah,9
cmp ah,64
jb s0
mov ah,0
add al,9
cmp al,64
jb s0
mov ax,13h
int 10h ; Grafik einschalten (VGA 320 x 200)
mov ax,1012h
mov bx,0
mov cx,256
mov dx,offset tab1
int 10h ; und Palette auf 64 Graustufen ändern.
s1:
push es
mov ax,es
add ax,1000h
mov es,ax
mov al,15 ; mittlere Kontrastwert
mov bl,32 ; ab dem 32.Pixel von links
mov bh,44 ; ab der 44.Zeile von oben
mov cx,320 ; 320 Pixel digitalisieren
mov dx,200 ; 200 Zeilen digitalisieren
mov di,0 ; Offsetadresse des Buffers
call digit ; und Digitalisieren
pop es
push ds
mov bx,0 ; Offsetadresse der VGA
mov ax,ds
add ax,1000h
mov ds,ax ; Segmentadresse des Buffers
mov cx,200 ; 200 Zeilen
s2:
push cx
mov si,0 ; Offsetadresse des Buffers
mov di,offset cs:buffer ; Offsetadresse des Zwischenspeichers
mov cx,320 ; 320 Pixel konvertieren
call convert
push es
push ds
push cs
pop ds
les di,vstart ; Adresse der VGA
add di,bx
mov si,offset buffer ; Offsetadresse des Zwischenspeichers
mov cx,320 ; 320 Pixel
s3:
lodsw ; Konvertierung von 0RRRRRGGGGGBBBBB
rol ax,1 ; nach RRRGGGBB
rol al,1
rol al,1
ror ax,1
ror ax,1
ror ax,1
ror ah,1
ror ah,1
ror ax,1
ror ax,1
ror ax,1
stosb
loop s3
pop ds
pop es
mov ax,ds
add ax,20
mov ds,ax ; Segmentadresse um 40 erhöhen
add bx,320 ; 320 Pixel überspringen
pop cx
loop s2
pop ds
mov ah,1
int 16h
jz s1 ; Wenn keine Taste gedrückt
mov ah,0
int 16h
mov ax,3
int 10h ; Auf Textmodus schalten
mov ah,4ch
int 21h ; Programm beenden
tab1 db 768 dup (?)
vstart dd 0a0000000h
buffer dw 768 dup (?)
code ends
stack segment para stack
dw 256 dup (?)
stack ends
end