Hullo All , hope you are having a nice day!!
/* (SCRN2BUF.ASM)
saveblock proc public
;**************************************
; On entry:
; cx= y coordinate
; dx= x coordinate
; bl= columns
; bh= rows
; es:di= pointer to buffer
; *************************************
MODECOLUMNS equ 320
; Preserve contents of registers
push ax
push bx
push cx
push dx
push bp
push ds
; Video memory segment
mov ax, 0a000h
mov ds, ax
; Here I calculate a number that will be added to si when the routine
; finishes storing a row, so that si will point to the beginning of the
; next row.
mov ax, bx
and ax, 11111111b
mov bp, MODECOLUMNS
sub bp, ax
; Here I calculate the beginning of the block I want to store.
push dx
mov ax, MODECOLUMNS
mul cx
pop dx
add ax, dx
mov si, ax
; cl will count the rows.
; 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 routine stores the specified contents of video memory in a buffer
; pointed by es:di
guardar:
push cx
mov cl, bl
rep movsb
add si, bp
pop cx
loop guardar
; Restore the contents of the registers.
pop ds
pop bp
pop dx
pop cx
pop bx
pop ax
; return
ret
saveblock 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: My girl, my girl, where were you born?? (4:900/470.10)
|