From Alpha Linux Wiki
Registers
Integer Registers
| Register
| Alternate Name
| Preserved?
| Purpose
|
| $0
| $v0 | No | Return Value
|
| $1-$8
| $t0-$t7 | No | Temporary Registers
|
| $9-$14
| $s0-$s5 | Yes | Saved Registers
|
| $15
| $s6 or $fp | Yes | Saved Register or Frame Pointer
|
| $16-$21
| $a0-$a5 | No | Function Arguments
|
| $22-$25
| $t8-$t11 | No | Temporary Registers
|
| $26
| $ra | Yes | Function Return Address
|
| $27
| $pv or $t12 | No | Procedure Value or Temporary Register
|
| $28
| $at | No | Reserved for Assembler
|
| $29
| $gp | No | Global Pointer
|
| $30
| $sp | Yes | Stack Pointer
|
| $31
| $zero | | Zero Sink
|
Floating-Point Registers
| Register
| Preserved?
| Purpose
|
| $f0
| No | Return Value
|
| $f1
| No | Return Value of Imaginary Part
|
| $f2-$f9
| Yes | Saved Registers
|
| $f10-$f15
| No | Temporary Registers
|
| $f16-$f21
| No | Function Arguments
|
| $f22-$f30
| No | Temporary Registers
|
| $f31
| | Zero Sink
|
Hello, World!
# hello.S
# gcc hello.S -o hello
# ./hello
.data
PRINT: .ascii "Hello, World!\n"
.text
.align 4
.set noreorder
.arch ev4
.globl main
.ent main
main: ldgp $gp,0($27) # load global pointer (necessary)
stq $26,0($sp) # setup stack pointer
lda $16,PRINT # load format string
# $16 is first argument to functions
jsr $26,printf # call printf
ldgp $gp,0($26) # reload global pointer
# (necessary after function calls)
mov $31,$0 # return val = 0
ldq $26,0($sp) # clean up stack
ret $31,($26),1 # return, (1 signifies return from a procedure)
.end main
External References