Talk About Network



Register and Login
Nick
Password
Register create new account Sign up is FREE and you can post replies, new topics, bookmark posts and more!
Recover lost password


Programming > Pascal Borland > Can Anyone tell...
Latest [ Topics | Posts ] Archive Post A New Topic Post a Reply
<< Topic < Post Post 1 of 8 Topic 1086 of 1102
Post > Topic >>

Can Anyone tell me why this doesn't work?

by HubbleBubble <phil_simmons@[EMAIL PROTECTED] > Feb 21, 2008 at 03:32 AM

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;




 8 Posts in Topic:
Can Anyone tell me why this doesn't work?
HubbleBubble <phil_sim  2008-02-21 03:32:51 
Re: Can Anyone tell me why this doesn't work?
Wolfgang.Ehrhardt.PLEASE.  2008-02-21 18:11:48 
Re: Can Anyone tell me why this doesn't work?
"Jason Burgon"   2008-02-22 01:24:25 
Re: Can Anyone tell me why this doesn't work?
HubbleBubble <phil_sim  2008-02-22 03:49:22 
Re: Can Anyone tell me why this doesn't work?
"Jason Burgon"   2008-02-22 15:26:06 
Re: Can Anyone tell me why this doesn't work?
Marco van de Voort <ma  2008-02-22 09:52:10 
Re: Can Anyone tell me why this doesn't work?
"Jason Burgon"   2008-02-23 06:12:47 
Re: Can Anyone tell me why this doesn't work?
HubbleBubble <phil_sim  2008-02-28 01:27:40 

Post A Reply:
  Go here to Signup

AddThis Feed Button


About - Advertising - Contact - Frequently Asked Questions - Privacy Policy - Terms of Use - Signup

Contact
tan12V112 Thu May 15 0:08:07 CDT 2008.