############################################## #This is an openrisc assembly test # #Just for test purposes # #'c' usually works fine for this # #Rich D 12/20/2006 ############################################## ############################################## #as -o helloWorld.o helloWorld.S #ld -s -o helloWorld helloWorld.o ############################################### ############################################### ############################################### .data ############################################### myStr: .string "hello new world\n" len = . - myStr ############################################### .text ############################################### .global _start #good old fashioned start .type _start,@function _start: l.addi r3,r0,0x1 #stdfileno into r3 arg1 l.movhi r4, hi(myStr) #move upper addr into r4 upper l.ori r4,r4,lo(myStr) #move lower adrr into r4 l.addi r5,r0,len #len of the string l.addi r11,r0,0x4 #system call 4 (write) l.sys 0x1 #call os l.nop 0x0 #fill delay l.j l_exit #jump to exit l.nop #fill delay .global l_exit #our exit function .type l_exit,@function l_exit: l.addi r11,r0,0x1 #sytem call 1 (exit) l.sys 1 #call os l.nop 0x0 #fill delay ###############################################