

.macro pushAll
	pushSs
	pushTs
	pushAs
	pushVs
	push ra
.endmacro

.macro popAll
	pop ra
	popVs
	popAs
	popTs
	popSs
.endmacro



.macro push,reg
	addi sp,sp,-4		;Subtract 4 from Stack pointer
	sw reg,0(sp)		;Put the register onto the stack
.endmacro

.macro pop,reg
	lw reg,0(sp)		;Pop the register off the stack
	addi sp,sp,4		;Add 4 to the Stack pointer
.endmacro

.macro pushSs
	  addi sp,sp,-32
      sw s0,0(sp)
      sw s1,4(sp)
      sw s2,8(sp)
      sw s3,12(sp)
	  sw s4,16(sp)
      sw s5,20(sp)
      sw s6,24(sp)
      sw s7,28(sp)
.endmacro

.macro popSs
      lw s0,0(sp)
      lw s1,4(sp)
      lw s2,8(sp)
      lw s3,12(sp)
	  lw s4,16(sp)
      lw s5,20(sp)
      lw s6,24(sp)
      lw s7,28(sp)
      addi sp,sp,32
.endmacro

.macro pushTs
	  addi sp,sp,-40
      sw t0,0(sp)
      sw t1,4(sp)
      sw t2,8(sp)
      sw t3,12(sp)
	  sw t4,16(sp)
      sw t5,20(sp)
      sw t6,24(sp)
      sw t7,28(sp)
	  sw t8,32(sp)
      sw t9,36(sp)
.endmacro

.macro popTs
      lw t0,0(sp)
      lw t1,4(sp)
      lw t2,8(sp)
      lw t3,12(sp)
	  lw t4,16(sp)
      lw t5,20(sp)
      lw t6,24(sp)
      lw t7,28(sp)
	  lw t8,32(sp)
	  lw t9,36(sp)
      addi sp,sp,40
.endmacro

.macro pushAs
	  addi sp,sp,-16
      sw a0,0(sp)
      sw a1,4(sp)
      sw a2,8(sp)
      sw a3,12(sp)
.endmacro

.macro popAs
      lw a0,0(sp)
      lw a1,4(sp)
      lw a2,8(sp)
      lw a3,12(sp)
      addi sp,sp,16
.endmacro


.macro pushVs
	  addi sp,sp,-8
      sw v0,0(sp)
      sw v1,4(sp)
.endmacro

.macro popVs
      lw v0,0(sp)
      lw v1,4(sp)
      addi sp,sp,8
.endmacro
