# # File: array3_mod.s # Author: William T Krieger, Oct 2003 # # My modification of the array2 test case. # Demonstrates an integer array as a local var .text FMT0: .ascii "The 1st element of z is %d\12\0" .align 32 FMT1: .ascii "The 2nd element of z is now %d\12\0" .align 4 # # Function: _main() # void _main() # Demonstrates a 3 integer array as a local variable .globl _main _main: pushl %ebp # enter _main() movl %esp, %ebp subl $12,%esp # adjust stack for local vars # int z[3] ; movl $7,-12(%ebp) # z[0] = 7 movl $10,-8(%ebp) # z[1] = 10 movl $5,-4(%ebp) # z[2] = 5 movl -12(%ebp),%eax # call printf( fmt0, z[0]) pushl %eax pushl $FMT0 call _printf addl $8,%esp movl $220,-8(%ebp) # z[1] = 220 movl -8(%ebp),%eax # call printf( fmt1, z[1]) pushl %eax pushl $FMT1 call _printf addl $8,%esp movl %ebp, %esp # exit _main() pop %ebp ret