|
Archives
D Programming
DD.gnu digitalmars.D digitalmars.D.bugs digitalmars.D.dtl digitalmars.D.dwt digitalmars.D.announce digitalmars.D.learn digitalmars.D.debugger C/C++ Programming
c++c++.announce c++.atl c++.beta c++.chat c++.command-line c++.dos c++.dos.16-bits c++.dos.32-bits c++.idde c++.mfc c++.rtl c++.stl c++.stl.hp c++.stl.port c++.stl.sgi c++.stlsoft c++.windows c++.windows.16-bits c++.windows.32-bits c++.wxwindows digitalmars.empire digitalmars.DMDScript electronics |
digitalmars.D - Feature Request: enhanced inline ASM
dynamic arrays in D is so common used that u will feel painful of dealing
with them in inline ASM.
i hope the following would be compilable:
char[] name
asm
{
mov EAX, name.ptr;
mov EBX, name.length;
}
For AA's we would still need to use the extern C func to deal with. but
the above code would give
devs great experience with inline ASM
Apr 02 2007
Davidl Wrote: ...mov EAX, name.ptr; mov EBX, name.length; Apr 03 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 :pDavidl Wrote: ...mov EAX, name.ptr; mov EBX, name.length; Apr 03 2007
Actually, no. But I failed to static the structs or test it. So we're going to do something that looks like: mov ECX, a.x[EAX]; mov ECX, b.s.ptr[ECX]; Excuse if my notation is off - but I think that should mean ECX is now a char* to b.s[0], which is technically null still. : p Most importantly though was the point, not the example. You can't follow pointer chains in one instruction in ASM, but you can do it in one line in D. Structure offsets? Sure! Pointers? No. Davidl Wrote: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 Apr 03 2007
Dan wrote: Apr 04 2007
|