Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Fixes Issue 9180 - Fix outdated ASM example.

  • Loading branch information...
commit 6d9762a90d5071dac693f83027efb45f4f20e631 1 parent d912ac1
Andrej Mitrovic authored
Showing with 8 additions and 3 deletions.
  1. +8 −3 iasm.dd
View
11 iasm.dd
@@ -332,8 +332,9 @@ 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:
)
--------------
@@ -341,9 +342,13 @@ 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>
Please sign in to comment.
Something went wrong with that request. Please try again.