Simple C code as compiled by different compilers
SPIM assembly
##################################################################
# addition of two integers
#that are automatic variables.
# the result is stored on stack.
#################################################################.verstamp 3 19
li $24, 22 # the compiler is smart:
# performs addtion of two constants
MIPS assembly
Pentium Assembly
TITLE F:\Cs342fall99\Sep27\testadd\addasm.c
_TEXT SEGMENT PARA USE32 PUBLIC 'CODE'
_DATA SEGMENT DWORD USE32 PUBLIC 'DATA'
CONST SEGMENT DWORD USE32 PUBLIC 'CONST'
_BSS SEGMENT DWORD USE32 PUBLIC 'BSS'
$$SYMBOLS SEGMENT BYTE USE32 'DEBSYM'
$$TYPES SEGMENT BYTE USE32 'DEBTYP'
_TLS SEGMENT DWORD USE32 PUBLIC 'TLS'