cis-lclient05:~/2012/system>more max.s # Data section begins # Declaration of memory variables # .byte, .int, .long, .ascii, .asciz, and .string .section .data var1: .int 40 var2: .int 20 var3: .int 30 .section .text .globl _start _start: # find max of three variables movl var1, %ecx cmpl var2, %ecx jg check_third_var movl var2, %ecx check_third_var: cmpl var3, %ecx jg _exit movl var3, %ecx _exit: movl $1, %eax movl %ecx, %ebx int $0x80 cis-lclient05:~/2012/system>as -o max.o max.s cis-lclient05:~/2012/system>ld -o max max.o cis-lclient05:~/2012/system>max cis-lclient05:~/2012/system>echo $? 40 cis-lclient05:~/2012/system>