BorlandTalk.com Forum Index BorlandTalk.com
Borland discussion newsgroups
 
Archives   FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

Converting components from D5 to D7 assembly errors

 
Post new topic   Reply to topic    BorlandTalk.com Forum Index -> Delphi Language BASM
View previous topic :: View next topic  
Author Message
bwinfrey
Guest





PostPosted: Thu Mar 10, 2005 9:55 pm    Post subject: Converting components from D5 to D7 assembly errors Reply with quote



I am trying to port a set of components to Delphi7 but the compiler
gives an error "inline assembler error" at this code as well as other
similar snippets:
if Surface.rgb_blue.Bitcount<7 then
begin
asm
jmp @@EndCode
@@StartCode:
mov ebx,edx
shr ebx,$11 {}@@BitCount: // 6-bitcount
and ebx,3
movzx ebx,byte ptr [ebp+ebx*4]
shl ebx,$11 {}@@BitCount2: // 8-bitcount
//* This is where the error occurs *//
movzx edx,byte [offset _AddTable+edx+ebx]
@@EndCode:
{$I DXRender.inc}
{ @@BitCount }
mov eax,6; mov edx,Surface; sub eax,[edx +
TDXR_Surface.rgb_blue.Bitcount]
mov edx,offset @@BitCount-1
sub edx,offset @@StartCode
mov byte ptr [ecx+edx],al

{ @@BitCount2 }
mov eax,8; mov edx,Surface; sub eax,[edx +
TDXR_Surface.rgb_blue.Bitcount]
mov edx,offset @@BitCount2-1
sub edx,offset @@StartCode
mov byte ptr [ecx+edx],al
end;
end;


Any help is greatly appreciated. I am not familiar with assembly.

Thanks,
Brian
Back to top
bwinfrey
Guest





PostPosted: Thu Mar 10, 2005 10:06 pm    Post subject: Re: Converting components from D5 to D7 assembly errors Reply with quote



bwinfrey wrote:

Quote:
I am trying to port a set of components to Delphi7 but the compiler
gives an error "inline assembler error" at this code as well as other
similar snippets:
if Surface.rgb_blue.Bitcount<7 then
begin
asm
jmp @@EndCode
@@StartCode:
mov ebx,edx
shr ebx,$11 {}@@BitCount: // 6-bitcount
and ebx,3
movzx ebx,byte ptr [ebp+ebx*4]
shl ebx,$11 {}@@BitCount2: // 8-bitcount
//* This is where the error occurs *//
movzx edx,byte [offset _AddTable+edx+ebx]
@@EndCode:
{$I DXRender.inc}
{ @@BitCount }
mov eax,6; mov edx,Surface; sub eax,[edx +
TDXR_Surface.rgb_blue.Bitcount]
mov edx,offset @@BitCount-1
sub edx,offset @@StartCode
mov byte ptr [ecx+edx],al

{ @@BitCount2 }
mov eax,8; mov edx,Surface; sub eax,[edx +
TDXR_Surface.rgb_blue.Bitcount]
mov edx,offset @@BitCount2-1
sub edx,offset @@StartCode
mov byte ptr [ecx+edx],al
end;
end;


Any help is greatly appreciated. I am not familiar with assembly.

Thanks,
Brian

I found the solution in a google search.
The correct sytax is:
movzx edx,byte [offset (_AddTable+edx+ebx)]

Thanks.

Back to top
Les Pawelczyk
Guest





PostPosted: Thu Mar 10, 2005 10:06 pm    Post subject: Re: Converting components from D5 to D7 assembly errors Reply with quote



Quote:
//* This is where the error occurs *//
movzx edx,byte [offset _AddTable+edx+ebx]


movzx edx, byte ptr[...]


Les.



Back to top
Display posts from previous:   
Post new topic   Reply to topic    BorlandTalk.com Forum Index -> Delphi Language BASM All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001, 2006 phpBB Group
SEO toolkit © 2004-2006 webmedic.