/* * Conventional register names. * taken from file xc.h of https://github.com/jasonkajita/pic32-part-support/ */ /* Zero register: Always returns 0 */ #define zero $0 /* Assembler temporary register: Reserved for use by the assembler */ #define at_reg $1 #define AT_reg $1 /* Return value registers: Value returned by subroutine */ #define v0 $2 #define v1 $3 /* Argument registers: First few parameters for a subroutine */ #define a0 $4 #define a1 $5 #define a2 $6 #define a3 $7 /* Subroutine register temporaries: Registers that subroutines can use * without saving */ #define t0 $8 #define t1 $9 #define t2 $10 #define t3 $11 #define t4 $12 #define t5 $13 #define t6 $14 #define t7 $15 #define t8 $24 #define t9 $25 /* Subroutine register variables: A subroutine that writes one of these * must save the old value and restore it before it exists, so the calling * routine sees the values preserved */ #define s0 $16 #define s1 $17 #define s2 $18 #define s3 $19 #define s4 $20 #define s5 $21 #define s6 $22 #define s7 $23 /* Ninth subroutine register variable: Can either be used as above or * as the frame pointer for functions that require one */ #define s8 $30 #define fp $30 /* Interrupt/Trap handler registers: Reserved for use by interrupt/trap * handler. May change under your feet! */ #define k0 $26 #define k1 $27 /* Global pointer register: Gives easy access to (some) `static' or `extern' * variables */ #define gp $28 /* Stack pointer register: Stack pointer */ #define sp $29 /* Return address register: Contains the return address for the subroutine */ #define ra $31