 |
BorlandTalk.com Borland discussion newsgroups
|
| View previous topic :: View next topic |
| Author |
Message |
bwinfrey Guest
|
Posted: Thu Mar 10, 2005 9:55 pm Post subject: Converting components from D5 to D7 assembly errors |
|
|
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
|
Posted: Thu Mar 10, 2005 10:06 pm Post subject: Re: Converting components from D5 to D7 assembly errors |
|
|
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
|
Posted: Thu Mar 10, 2005 10:06 pm Post subject: Re: Converting components from D5 to D7 assembly errors |
|
|
| Quote: | //* This is where the error occurs *//
movzx edx,byte [offset _AddTable+edx+ebx]
|
movzx edx, byte ptr[...]
Les.
|
|
| Back to top |
|
 |
|
|
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
|
|