# # File: array2_mod.s # Author: William T Krieger, Oct 2003 # # My modification of the array2 test case. # Demonstrates the definition and use of an un-initialized array. .bss # bss section: un-initialized global vars y: .long 12 # int y[3]; .text FMT0: .ascii "The 1st element of y is %d\12\0" FMT1: .ascii "The 2nd element of y is now %d\12\0" # # Function: _main() # void _main() # Demonstrates an un=initialized array. .globl _main _main: pushl %ebp # enter _main() movl %esp, %ebp movl y,%eax # call printf( fmt0, y[0]) pushl %eax pushl $FMT0 call _printf addl $8,%esp movl $100,y+4 # y[1] = 100 movl y+4,%eax # call printf( fmt1, y[1]) pushl %eax pushl $FMT1 call _printf addl $8,%esp movl %ebp, %esp # exit _main() pop %ebp ret