TIP: Click on subject to list as thread! ANSI
echo: 80xxx
to: ALL
from: FERNANDO ARIEL GONT
date: 1998-03-05 05:55:00
subject: buf2scrn.asm

Hullo All , hope you are having a nice day!!
/* (BUF2SCRN.ASM)
restoreblock proc public
;**************************************
; On entry:
; cx= y coordinate
; dx= x coordinate
; bl= columns
; bh= rows
; ds:si= pointer to buffer
; *************************************
MODECOLUMNS equ 320
; Preserve the contents of the registers.
        push ax
        push bx
        push cx
        push dx
        push bp
; es= video memory segment
        mov ax, 0a000h
        mov es, ax
; Here I calculate the number I will add to di to get the address of
; the beggining of the next row.
        mov ax, bx
        and ax, 11111111b
        mov bp, MODECOLUMNS
        sub bp, ax
; Here I calculate the address of the first pixel of the block I want
; to restore.
        push dx
        mov ax, MODECOLUMNS
        mul cx
        pop dx
        add ax, dx
        mov di, ax
; cld, so that the index registers will be incremented.
        cld
        xor cx, cx
        mov cl, bh
; Wait for vertical retrace.
        mov dx, 3dah
esperarel1:
        in al, dx        
        and al, 8
        jz esperarel1
esperarel0:
        in al, dx
        and al, 8
        jnz esperarel0
; this loop restores a block of pixels to the video memory.
        
restaurar:
        push cx
        mov cl, bl
        rep movsb
        add di, bp
        pop cx
        loop restaurar
; Restore the contents of the registers
        pop bp
        pop dx
        pop cx
        pop bx
        pop ax
        ret
restoreblock endp
*/
 -=> Yours sincerely, Fernando Ariel Gont <=-
e-mail: FGont@siscor.bibnal.edu.ar
e-mail "Good Stuff!" _*Magazine*_ : gstuff@siscor.bibnal.edu.ar
FidoNet: 4:900/470.10
Sk-Network (Argentina): Murdock's Point (200:201/300.27)
--- Terminate 5.00 UnReg(142)
---------------
* Origin: This point doesn't suck!! (4:900/470.10)

SOURCE: echomail via exec-pc

Email questions or comments to sysop@ipingthereforeiam.com
All parts of this website painstakingly hand-crafted in the U.S.A.!
IPTIA BBS/MUD/Terminal/Game Server List, © 2025 IPTIA Consulting™.