[Issue 8448] New: Take address of label (at least in inline asm)

d-bugmail at puremagic.com d-bugmail at puremagic.com
Thu Jul 26 14:11:40 PDT 2012


http://d.puremagic.com/issues/show_bug.cgi?id=8448

           Summary: Take address of label (at least in inline asm)
           Product: D
           Version: D2
          Platform: All
        OS/Version: All
            Status: NEW
          Severity: enhancement
          Priority: P2
         Component: DMD
        AssignedTo: nobody at puremagic.com
        ReportedBy: dmitry.olsh at gmail.com


--- Comment #0 from Dmitry Olshansky <dmitry.olsh at gmail.com> 2012-07-26 14:11:39 PDT ---
See also NG discussion:
http://forum.dlang.org/thread/gltqflqrvsxggarxjkde@forum.dlang.org?page=5

So address of label can be taken via some asm trick:

size_t address;
asm{
call L_label;
add EAX, 4;
move address, EAX
}
//OK now address points where needed

...

L_label:
asm{
move EAX, [ESP];
ret; 
}
//<<--- want code pointer here
....

The request is to allow direct use of label addresses in contexts other then
jump/call:
lea, mov,  etc. 

An extension of that would be to introduce taking of label address in normal D
code to aid portability, but that's the whole other question.

-- 
Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email
------- You are receiving this mail because: -------


More information about the Digitalmars-d-bugs mailing list