Feature Request: enhanced inline ASM

Davidl Davidl at 126.com
Tue Apr 3 09:28:45 PDT 2007


u should use classes to explain the confusion there ;)
coz ur example, the type of x is just void* so no attribute
of s or even s.ptr :p

> Davidl Wrote:
> ...
>> 	mov EAX, name.ptr;
>> 	mov EBX, name.length;
>>
> ...
>> For AA's we would still need to use the extern C func to deal with.
> ...
>
> I agree m8.  That syntax is much more attractive to us assembly  
> programmers as well.  The thing that I'm sure Walter doesn't want to do  
> though is trick assembler programmers into thinking they can access a  
> ways down the "." chain all the time.
>
> Let me explain: If we have:
>
> struct b {
>   char[] s;
> }
>
> struct a {
>   void* x = b;
>   union y {
>     int z;
>   }
> }
>
>
>
> You can access a.y.z, but not a.x.s.ptr  The first just performs a  
> structure offset while the second has to lea through x, and then again  
> through b.s.ptr; more than one instruction ought to be illegal.  It's  
> asm after all.
>
> You can theoretically have D perform any single asm op to do the correct  
> lookup into a structure or object - but you have to be aware of what's  
> happening.




More information about the Digitalmars-d mailing list