3.67

    1. !INCLUDE "./code/3.67.c"
    1. !INCLUDE "./code/3.67.s"

    A.

    1. 104 +------------------+
    2. | |
    3. | |
    4. | |
    5. | |
    6. | |
    7. | |
    8. | |
    9. | |
    10. 64 +------------------+ <-- %rdi
    11. | |
    12. | |
    13. | |
    14. | |
    15. | |
    16. | |
    17. 32 +------------------+
    18. | z |
    19. 24 +------------------+
    20. | &z |
    21. 16 +------------------+
    22. | y |
    23. 8 +------------------+
    24. | x |
    25. 0 +------------------+ <-- %rsp

    B.

    eval pass a new address %rsp+64 to process

    C.

    process access s by %rsp+offset, not by %rdi

    D.

    eval pass address %rsp+64 to process, process store data from here as beginning,
    finially return this address

    E.

    1. 104 +------------------+
    2. | |
    3. | |
    4. | |
    5. | |
    6. | |
    7. | |
    8. 88 +------------------+
    9. | z |
    10. 80 +------------------+
    11. | x |
    12. 72 +------------------+
    13. | y |
    14. 64 +------------------+ <-- %rdi(eval pass in)
    15. | | \
    16. | | -- %rax(process pass out)
    17. | |
    18. | |
    19. | |
    20. | |
    21. 32 +------------------+
    22. | z |
    23. 24 +------------------+
    24. | &z |
    25. 16 +------------------+
    26. | y |
    27. 8 +------------------+
    28. | x |
    29. 0 +------------------+ <-- %rsp in eval
    30. | |
    31. -8 +------------------+ <-- %rsp in process

    F.

    caller find space and pass space address to callee, callee store data on this
    space area and return this address