Hi All,
This is a bita Vesa(256) code to get a line of pixels - it works fine
in protected mode but hangs mysteriously in real mode - I'm fairly new
to asm & wressling with the segment registers and I can't see what it
is that I'm doing wrong - all suggestions welcome (Jason?)
:) Phil
procedure gline8(x1,x2,y :word;var Buff :pointer);assembler;
{hangs in real mode , fine in prot}
asm
cld
mov di, offset Buff
mov cx,x1
@[EMAIL PROTECTED]
push cx
mov bx,y
shl bx,2
DB $66
mov si,word ptr LineOffsets[bx]
DB $66
mov ax,cx
DB $66
add si,ax
DB $66
mov bx,si
DB $66
shr bx,16
{ the above should be shld ebx,esi,16 but I don't know the
opcodes :)}
cmp bx,CurReadBank
je @[EMAIL PROTECTED]
mov CurReadBank,bx ; { reset to new page }
add bx,bx
DB $66
mov dx,word ptr BankVals[bx]
xor bx,bx
call dword ptr switchbank
{ same as mov ax,$4F05
int 10H or WinfuncPtr in real mode}
mov bx,ReadWindow
test bx,bx
jnz @[EMAIL PROTECTED]
mov bx,CurReadBank
mov CurWriteBank,bx
@[EMAIL PROTECTED]
push ds
mov ds,SegA000
movsb
pop ds
@[EMAIL PROTECTED]
pop cx
inc cx
cmp cx,x2
jc @[EMAIL PROTECTED]
end;


|