Since you access a field through `a` instance, this is usually done by loading the instance address into some register and reading from a location at a certain offset from that register

mov esi, [ebp-4] # the instance address
mov eax, [esi+8] # first field
...
mov [ebp-4], 0 # clear stack variable
...
call collect
...
ret # from main


collect:
...
push esi
...
pop esi
ret


Note the instance address is preserved in a register even if it's not needed. And this happen only if you read a field.

Reply via email to