home *** CD-ROM | disk | FTP | other *** search
/ Amiga ISO Collection / AmigaUtilCD2.iso / Programming / Misc / CLISP-1.LHA / CLISP960530-sr.lha / amiga / jchlib / startup / crt0.s < prev    next >
Encoding:
Text File  |  1996-04-15  |  508 b   |  30 lines

  1. #APP
  2. | GCC Library
  3. | Jörg Höhle, 29-Nov-92
  4. | I wanted _exit() a fall-through of _main()
  5. | which is not possible in C, so I wrote it in assembly.
  6. .text
  7.     .even
  8. .globl _ENTRY
  9. _ENTRY:
  10.     | save all but scratch registers, why not?
  11.     moveml #0x3f3e,sp@-
  12.     movel sp,___ExitSP
  13.     movel 4:w,_SysBase
  14.     | call _main(arglen,argline);
  15.     movel a0,sp@-
  16.     movel d0,sp@-
  17.     jbsr __main
  18.     jra L101
  19. .globl __exit
  20. __exit:
  21.     movel sp@(4),d0
  22. L101:
  23.     movel ___ExitSP,sp
  24.     moveml sp@+,#0x7cfc
  25.     rts
  26. .data
  27.     .even
  28. .comm ___ExitSP,4
  29. .comm _SysBase,4
  30.