Hi! im trying to make a procedure wich saves what is on screen in a variable defined on the data segment (antes dw 2000 dup (?)). It compiles well but it freezes the program when it is called by it(program). BTW: this program is in textmode 80x25 16-bit and i am not allowed to use BIOS or DOS interruptions:
;Saves the screen image insede a rectangle
;in variable antes on the data segment.
;gets the upper left corner of the rectangle from bx
;gets the lower right corner of the rectangle from ax
;the rectangle's width in cx
;|------cx---------|
;
;
;bx-----------------
;| |
;| |
;------------------ax
guarda PROC NEAR
push ax
push bx
push cx
push dx
push si
xor si, si
c2: push cx
push bx
mov dx, word ptr es:[bx]
mov antes[si], dx
inc si
add bx, 2
loop c2
pop cx
cmp ax, bx
je fgurda
pop bx
add bx, 160
jmp c2
fgurda: pop bx
pop si
pop dx
pop cx
pop bx
pop ax
ret
guarda EndP
Any ideas of what is wrong?