# hello.asm­­ A "Hello World" program. # Registers used: # $v0 ­ syscall parameter and return value. # $a0 ­ syscall parameter­­ the string to print. .text .globl __start __start: la $a0, hello_msg # load the addr of hello_msg into $a0. li $v0, 4 # 4 is the print_string syscall. syscall # do the syscall. li $v0, 10 # 10 is the exit syscall. syscall # do the syscall. # Data for the program: .data hello_msg: .asciiz "Hello World\n" # end hello.asm # .data # hello_msg: .ascii "hello" # .ascii " " # .ascii "World" # .ascii "\n" # .byte 0 # or else # hello_msg: .byte 0x48 (H) # .byte 0x65 (e) # etc. # # .byte 0x0 (null) #