Category : Files from Magazines
Archive   : DDJSRC.ZIP
Filename : VPEEK.ASM

 
Output of file : VPEEK.ASM contained in archive : DDJSRC.ZIP
;--------------------------- vpeek.asm ----------------------------
dosseg
.model compact
.code
public _vpoke
; -------- insert a word into video memory
; vpoke(vseg, adr, ch);
; unsigned vseg; /* the video segment address */
; unsigned adr; /* the video offset address */
; unsigned ch; /* display byte & attribute byte */
; ------------------------------------------
_vpoke proc
push bp
mov bp,sp
push di
push es
mov cx,4[bp] ; video board base address
mov es,cx
mov di,6[bp] ; offset address from caller
mov dx,986 ; video status port address
loop1: in al,dx ; wait for retrace to quit
test al,1
jnz loop1
loop2: in al,dx ; wait for retrace to start
test al,1
jz loop2
mov ax,8[bp] ; word to insert
stosw ; insert it

pop es
pop di
pop bp
ret
_vpoke endp

public _vpeek
; -------- retrieve a word from video memory
; vpeek(vseg, adr);
; unsigned vseg; /* the video segment address */
; unsigned adr; /* the video offset address */
; ------------------------------------------
_vpeek proc
push bp
mov bp,sp
push si
push ds
mov si,6[bp] ; offset address
mov cx,4[bp] ; video board base address
mov ds,cx
mov dx,986 ; video status port address
loop3: in al,dx ; wait for retrace to stop
test al,1
jnz loop3
loop4: in al,dx ; wait for retrace to start
test al,1
jz loop4
lodsw ; get the word
pop ds
pop si
pop bp
ret
_vpeek endp
end


  3 Responses to “Category : Files from Magazines
Archive   : DDJSRC.ZIP
Filename : VPEEK.ASM

  1. Very nice! Thank you for this wonderful archive. I wonder why I found it only now. Long live the BBS file archives!

  2. This is so awesome! 😀 I’d be cool if you could download an entire archive of this at once, though.

  3. But one thing that puzzles me is the “mtswslnkmcjklsdlsbdmMICROSOFT” string. There is an article about it here. It is definitely worth a read: http://www.os2museum.com/wp/mtswslnk/