#------------------------------------------------------------------------------- # Thomas C. Bressoud # 31 January 2007 # empty.s # # Description: Simple first program that does nothing #------------------------------------------------------------------------------- # Following directive defines additions to the data segment .data .align 2 ; Start on 4 byte boundary # Put our global data definitions here ... # Following directive defines additions to the text (code) segment .text .align 2 ; Start on a 4 byte boundary .globl _main ; Make the _main symbol visible outside this module _main: ; Function prologue mflr r0 ; Put the return address from main into r0 stw r0,8(r1) ; Save in the linkage of the callers stack frame stwu r1,-32(r1) ; Allocate a new stack frame, updating the stack ptr # Do something in here in the body of _main ; Function epilogue addi r1, r1, 32 lwz r0, 8(r1) mtlr r0 blr