asm woes...

Marco Leise via Digitalmars-d-learn digitalmars-d-learn at puremagic.com
Tue May 31 11:25:53 PDT 2016


Am Fri, 27 May 2016 10:06:28 +0000
schrieb Guillaume Piolat <first.last at gmail.com>:

> Referencing EBP or ESP yourself is indeed dangerous. Not sure why 
> the documentation would advise that. Using "this", names of 
> parameters/locals/field offset is much safer.

DMD makes sure that the EBP relative access of parameters and
stack variables works by copying everything to the stack
that's in registers when you have an asm block in the
function. Using var[EBP] or just plain var will then
dereference that memory location.

-- 
Marco



More information about the Digitalmars-d-learn mailing list