main9p.s 619 B

12345678910111213141516171819202122232425262728293031323334353637
  1. #define NPRIVATES 16
  2. TEXT _mainp(SB), 1, $(16 + NPRIVATES*4)
  3. MOVW $setSB(SB), R2
  4. MOVW R3, _tos(SB)
  5. MOVW $p-64(SP), R4
  6. MOVW R4, _privates+0(SB)
  7. MOVW $16, R4
  8. MOVW R4, _nprivates+0(SB)
  9. BL _profmain(SB)
  10. MOVW _tos(SB), R3
  11. MOVW 4(R3), R4
  12. MOVW R4, 0(R3)
  13. MOVW inargc-4(FP), R3
  14. MOVW $inargv+0(FP), R4
  15. MOVW R3, 4(R1)
  16. MOVW R4, 8(R1)
  17. BL main(SB)
  18. loop:
  19. MOVW $exits<>(SB), R3
  20. MOVW R3, 4(R1)
  21. BL exits(SB)
  22. MOVW $_profin(SB), R3 /* force loading of profile */
  23. BR loop
  24. TEXT _savearg(SB), 1, $0
  25. RETURN
  26. TEXT _callpc(SB), 1, $0
  27. MOVW argp-4(FP), R3
  28. RETURN
  29. DATA exits<>+0(SB)/4, $"main"
  30. GLOBL exits<>+0(SB), $5