Thread overview
[Issue 5302] Inline assembler: Indexing struct fields not possible inside member function
Aug 20, 2020
Walter Bright
Aug 21, 2020
Walter Bright
June 09, 2015
https://issues.dlang.org/show_bug.cgi?id=5302

Andrei Alexandrescu <andrei@erdani.com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
            Version|D1 & D2                     |D2

--
October 14, 2016
https://issues.dlang.org/show_bug.cgi?id=5302

Andrei Alexandrescu <andrei@erdani.com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
           Keywords|                            |bootcamp
                 CC|                            |andrei@erdani.com

--
October 14, 2016
https://issues.dlang.org/show_bug.cgi?id=5302

Andrei Alexandrescu <andrei@erdani.com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
           Keywords|                            |bootcamp
                 CC|                            |andrei@erdani.com

--
August 20, 2020
https://issues.dlang.org/show_bug.cgi?id=5302

Walter Bright <bugzilla@digitalmars.com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |bugzilla@digitalmars.com

--- Comment #4 from Walter Bright <bugzilla@digitalmars.com> ---
The attachment:

module iasm_test;

struct S
{
    uint i;
}

class A
{
    uint func(S* s)
    {
        asm
        {
            mov     EDX, s;
            mov     EAX, S.i[EDX];
        }
    }
}

--
August 21, 2020
https://issues.dlang.org/show_bug.cgi?id=5302

Walter Bright <bugzilla@digitalmars.com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|NEW                         |RESOLVED
         Resolution|---                         |INVALID

--- Comment #5 from Walter Bright <bugzilla@digitalmars.com> ---
The parser for the iasm operator expressions is quite limited compared with the regular D expressions is quite limited. It is also different in order to be like the Intel assembler syntax. However, this case can be handled using:

    mov EAX, S.i.offsetof[EDX];

instead of:

    mov EAX, S.i[EDX];

Marked as invalid because there is a way to make it work.

--