head.S 710 B

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455
  1. #include "sys.h"
  2. #include "picorv32.h"
  3. // The linker ensures that section .init is first
  4. .section ".init","ax"
  5. .org 0
  6. .globl _reset
  7. _reset:
  8. li sp,SRAM_SIZE
  9. j _start
  10. .org 0x10
  11. .globl __irq
  12. __irq:
  13. add sp,sp,-64
  14. sw ra,0(sp)
  15. sw t0,4(sp)
  16. sw t1,8(sp)
  17. sw t2,12(sp)
  18. sw t3,16(sp)
  19. sw t4,20(sp)
  20. sw t5,24(sp)
  21. sw t6,28(sp)
  22. sw a0,32(sp)
  23. sw a1,36(sp)
  24. sw a2,40(sp)
  25. sw a3,44(sp)
  26. sw a4,48(sp)
  27. sw a5,52(sp)
  28. sw a6,56(sp)
  29. sw a7,60(sp)
  30. getq a0,q1
  31. jal _irq
  32. lw ra,0(sp)
  33. lw t0,4(sp)
  34. lw t1,8(sp)
  35. lw t2,12(sp)
  36. lw t3,16(sp)
  37. lw t4,20(sp)
  38. lw t5,24(sp)
  39. lw t6,28(sp)
  40. lw a0,32(sp)
  41. lw a1,36(sp)
  42. lw a2,40(sp)
  43. lw a3,44(sp)
  44. lw a4,48(sp)
  45. lw a5,52(sp)
  46. lw a6,56(sp)
  47. lw a7,60(sp)
  48. add sp,sp,64
  49. retirq