mirror of
https://github.com/pkivolowitz/asm_book.git
synced 2026-06-22 22:46:47 +08:00
benefit of .struct
This commit is contained in:
parent
3e207094c9
commit
bb1bee8c2c
1 changed files with 4 additions and 3 deletions
|
|
@ -115,7 +115,8 @@ Foo.c: // 23
|
||||||
fmt: .asciz "%p a: 0x%x b: 0x%x c: 0x%x\n" // 27
|
fmt: .asciz "%p a: 0x%x b: 0x%x c: 0x%x\n" // 27
|
||||||
```
|
```
|
||||||
|
|
||||||
We aren't sure this method has anything to commend it over the previous
|
This method has a *substantial* benefit over the previous methods. Imagine
|
||||||
method other than it does emphasize that offsets are relative to the
|
you need to insert a new field between `Foo.a` and `Foo.b`. Simply do so.
|
||||||
data member that comes before it.
|
If you're using this third method, which is based on relative offsets, the
|
||||||
|
assembler will do the work of adjusting the following offsets for you.
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue