Skip to content

Commit

Permalink
Merge pull request #221 from AndrejMitrovic/Fix9180
Browse files Browse the repository at this point in the history
Issue 9180 - Fix outdated ASM example.
  • Loading branch information
alexrp committed Dec 27, 2012
2 parents e389634 + 6d9762a commit 1fcf488
Showing 1 changed file with 8 additions and 3 deletions.
11 changes: 8 additions & 3 deletions iasm.dd
Expand Up @@ -332,18 +332,23 @@ add int ptr [EAX],7 ;

<h3>Struct/Union/Class Member Offsets</h3>

$(P To access members of an aggregate, given a pointer to the aggregate
is in a register, use the qualified name of the member:
$(P To access members of an aggregate, given a pointer to the aggregate
is in a register, use the $(B .offsetof) property of the qualified name
of the member:
)

--------------
struct Foo { int a,b,c; }
int bar(Foo *f) {
asm {
mov EBX,f ;
mov EAX,Foo.b[EBX] ;
mov EAX,Foo.b.offsetof[EBX] ;
}
}
void main() {
Foo f = Foo(0, 2, 0);
assert(bar(&f) == 2);
}
--------------

<h3>Stack Variables</h3>
Expand Down

0 comments on commit 1fcf488

Please sign in to comment.