init9.s 572 B

1234567891011121314151617181920212223242526272829
  1. /* this is the same as a c program:
  2. * main(char *argv0){
  3. * startboot(argv0, &argv0);
  4. * }
  5. *
  6. * it is in asm because we need to set the SB before
  7. * doing it and the only way to do this in c drags in
  8. * too many other routines.
  9. */
  10. TEXT _main(SB),$8
  11. MOVW $setSB(SB), R2
  12. /* make a frame */
  13. SUB $16,R1
  14. /* argv0 is already passed to us in R3 so it is already the first arg */
  15. /* copy argv0 into the stack and push its address as the second arg */
  16. MOVW R3,0x14(R1)
  17. ADD $0x14,R1,R6
  18. MOVW R6,0x8(R1)
  19. BL startboot(SB)
  20. /* should never get here */
  21. loop:
  22. BR loop