_kernel_library_stub.s 924 B

1234567891011121314151617181920212223242526272829303132
  1. | Kernel Library Stub
  2. | This belongs to the kernel headers.
  3. .xdef __kernel_library_stub,__not_executable_msg
  4. .section _stl12
  5. | This is the kernel library stub starting point.
  6. __kernel_library_stub:
  7. | This does two things:
  8. | 1. Put the address of __not_executable_msg on the stack.
  9. | 2. Jump to .L__disp_msg.
  10. | Note that it will not return normally, but remove even four more bytes from
  11. | the stack.
  12. jbsr .L__disp_msg
  13. __not_executable_msg:
  14. .asciz "Libraries are not executable"
  15. .even
  16. | This routine is not a normal function: It returns from the entire program.
  17. .L__disp_msg:
  18. | Get the address of the jump table in %a0.
  19. move.l 0xC8,%a0
  20. | Get the address of ST_helpMsg in %a0.
  21. move.l (%a0,0xE6*4),%a0 /* ST_helpMsg */
  22. | Call ST_helpMsg.
  23. jsr (%a0)
  24. | Clean up the stack.
  25. | Remove the last return address as well
  26. | (from the bsr.w at the beginning of the program).
  27. addq.w #8,%sp
  28. | Return from the entire program.
  29. rts