
32 Introduction to Concurrency in Programming Languages
Listing 2.2: The x86 assembly that corresponds to Listing 2.1.
1 . text
2 . globl _fun
3 _fun :
4 pushl % ebp
5 movl %esp , % ebp
6 subl $408 , % esp
7 movl -240(% ebp ), % eax
8 addl $1 , % eax
9 movl %eax , -240(% ebp )
10 leave
11 ret
12 . s u b s e c t i o ns_via_symbols
operations.
The key lines in the assembly are lines 7 through 9. On line 7, the specific
entry in the array is loaded into a register (the value -240 is the offset into
the stack frame for the stack allocated array — this is unimportant.) On line
8, the value is incremented by one, and line 9 commits the value from the
register back to ...