home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Der Mediaplex Sampler - Die 6 von Plex
/
6_v_plex.zip
/
6_v_plex
/
DISK2
/
MULTI_04
/
I2R.ZIP
/
SHOWPIC.ASM
< prev
next >
Wrap
Assembly Source File
|
1991-10-06
|
7KB
|
336 lines
;======================================================================
;||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
;======================================================================
;======================================================================
;||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
;======================================================================
CODE SEGMENT PARA 'CODE'
ORG 100h
ASSUME CS:CODE, DS:CODE, ES:CODE, SS:CODE
START: jmp INIT
;======================================================================
SHOWELCOM PROC NEAR
ELSTART: cli
call GETVID
call ORGRAM
call OPENFILES
call SET256
call READFILES
; call TRANSPIC
call GETKEY
ELEND: call RESVID
call CLOSEHANDLE
sti
mov ax,4c00h
int 21h
SHOWELCOM ENDP
;======================================================================
SET256 PROC NEAR
call VBLANC
mov ah,00
mov al,13h ;320*200/256 Farben
int 10h
ret
SET256 ENDP
;======================================================================
TRANSPIC PROC NEAR
ENTPAK: push ds
mov ds,PICRAM ;source
mov si,2
mov dx,0a000h ;destination
mov es,dx
xor di,di
mov dx,ds:[si-2] ;get length
sub dx,2h ;
cld
ENTPLOOP: lodsb
dec dx
cmp al,0
jl NORMPAK
UNPACK: xor ch,ch
mov cl,al
inc cx
lodsb
rep stosb
dec dx
cmp dx,0
jle PACKEND
jmp ENTPLOOP
NORMPAK: not al
xor ah,ah
inc ax
mov cx,ax
sub dx,ax
rep movsb
cmp dx,0
jle PACKEND
jmp ENTPLOOP
PACKEND: cmp dx,00h
jb ENTPLOOP
pop ds
ret
TRANSPIC ENDP
;======================================================================
ORGRAM PROC NEAR
; mov bx,65536/16 ;17072 Bytes (body)
; call GETRAM
; mov PICRAM,ax
mov bx,768/16 ;768 Bytes (colors)
call GETRAM
mov COLRAM,ax
ret
ORGRAM ENDP
;======================================================================
GETRAM PROC NEAR
mov ah,48h ;Speicher reservieren
int 21h
ret
GETRAM ENDP
;======================================================================
GETKEY PROC NEAR
mov ah,0ch
mov al,01h
int 21h ;Warten auf Tastendruck
ret
GETKEY ENDP
;======================================================================
WRSTRING PROC NEAR
mov ah,13h ;Zeichenkette ausgeben
mov al,01h ;Cursorpos. aktualisieren
mov cx,2ch ;26 Zeichen
mov dh,0eh ;Zeile
mov dl,12h ;Spalte
mov bl,10011100b ;ROT blinkend!
mov bh,BSEITE ;Bildschirmseite holen
int 10h
call GETKEY
ret
WRSTRING ENDP
;======================================================================
OPENFILES PROC NEAR
lea bx,COLNAM
call GETHANDLE
mov COLHANDLE,ax ;rette Datei-Handle
lea bx,PICNAM
call GETHANDLE
mov PICHANDLE,ax ;rette Datei-Handle
ret
OPENFILES ENDP
;======================================================================
GETHANDLE PROC NEAR
mov ax,cs
mov ds,ax
mov ah,3dh ;Datei öffnen (Handle)
mov al,00h ;nur lesen!
mov dx,bx ;Offset
int 21h
jc CHERROR
ret
;-----------------
CHERROR: lea bp,INITERR ;Error ausgeben
mov bx,2eh
sub ax,02h
mul bx
add bp,ax
call WRSTRING
jmp ELEND
ret
GETHANDLE ENDP
;======================================================================
CLOSEHANDLE PROC NEAR
mov cx,02h
lea dx,COLHANDLE
DOCLOSE: mov bx,dx
mov bx,es:[bx]
cmp bx,00h
jz NOHAND
mov ah,3eh ;doit
int 21h
NOHAND: add dx,02h ;next Handle
loop DOCLOSE
ret
CLOSEHANDLE ENDP
;======================================================================
READFILES PROC NEAR
mov bx,COLHANDLE
mov cx,-1
mov dx,COLRAM
call READ
call BURSTCOL
mov bx,PICHANDLE
mov cx,-1
mov dx,PICRAM
call READ
ret
READFILES ENDP
;======================================================================
READ PROC NEAR
push ds
mov ds,dx ;Segmentadresse
xor dx,dx ;Offset
mov ah,3fh ;Datei lesen
int 21h
pop ds
ret
READ ENDP
;======================================================================
BURSTCOL PROC NEAR
call VBLANC ;wait until vertical blanking
mov es,COLRAM
xor bx,bx
xor cx,cx ;cl=start first color and counter
mov dx,03c8h ;dx=03c8 write pel address reg.
mov al,cl ;locate address
out dx,al ;write the following datas
inc dx ;dx=03c9 : pel data reg.
COLLOOP: mov al,es:[bx] ;R
out dx,al
mov al,es:[bx+1] ;G
out dx,al
mov al,es:[bx+2] ;B
out dx,al
add bx,03h
inc cl
jnz COLLOOP
ret
BURSTCOL ENDP
;======================================================================
VBLANC PROC NEAR
mov dx,3dah ;input status reg. #1
VE1: in al,dx ;get data
test al,8 ;vert. retrace ?
je VE1
ret
VBLANC ENDP
;======================================================================
RESVID PROC NEAR
call VBLANC
xor ah,ah ;auf Originalzustand
mov al,VMODE ;zurückschalten
mov bh,BSEITE
int 10h
ret
RESVID ENDP
;======================================================================
GETVID PROC NEAR
mov ah,0fh ;Auslesen des Videomodus
int 10h
mov BSEITE,bh
mov VMODE,al
cmp al,7
jne GOUT
jmp ELEND
GOUT: ret
GETVID ENDP
;======================================================================
;======================================================================
OPENERR db " >>> fehlende File-Sharing-Software <<< "
db " >>> Datei nicht gefunden <<< "
db " >>> Datei existiert nicht! <<< "
db " >>> kein freies Handle mehr! <<< "
db " >>> Zugriff verweigert ! <<< "
INITERR db " >>> Grafik nicht gefunden! <<< "
db " >>> kein freies Handle <<< "
db " >>> Zugriff verweigert <<< "
PICRAM dw 0a000h
COLRAM dw 0
PICNAM db "dario.pic",0
COLNAM db "dario.col",0
COLHANDLE dw 0
PICHANDLE dw 0
BSEITE db 0
VMODE db 0
db 'DZ'
;======================================================================
;======================================================================
;||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
;== INIT =============================================================
INIT: mov ah,4ah
mov bx,offset ende
mov cl,4
shr bx,cl
inc bx
int 21h
mov sp,offset ende
jmp ELSTART
INIT_ENDE LABEL NEAR
;======================================================================
;||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
;== STACK =============================================================
dw (256-((init_ende-init) shr 1)) dup (?)
ENDE equ this byte
;======================================================================
;||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
;== ENDE ==============================================================
CODE ENDS
END START