head_em.s 1.0 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465
  1. .define .lino,.filn
  2. .define EXIT
  3. .define begtext,begdata,begbss
  4. .define EARRAY,ERANGE,ESET,EIDIVZ,EHEAP,EILLINS,ECASE,EBADGTO
  5. .define hol0,.reghp,.limhp,.trpim,.trppc
  6. .sect .text
  7. .sect .rom
  8. .sect .data
  9. .sect .bss
  10. ! EM runtime start-off for MINIX ST
  11. LINO_AD = 0
  12. FILN_AD = 4
  13. EARRAY = 0
  14. ERANGE = 1
  15. ESET = 2
  16. EIDIVZ = 6
  17. EHEAP = 17
  18. EILLINS = 18
  19. ECASE = 20
  20. EBADGTO = 27
  21. .sect .text
  22. begtext:
  23. move.l sp,a0
  24. move.l (a0)+,d0
  25. move.l d0,d1
  26. add.l #1,d1
  27. asl.l #2,d1 ! pointers are four bytes on 68000
  28. move.l a0,a1
  29. add.l d1,a1
  30. move.l a1,-(sp) ! push environ
  31. move.l a0,-(sp) ! push argv
  32. move.w d0,-(sp) ! push argc
  33. jsr __m_a_i_n
  34. add #010,sp
  35. EXIT:
  36. move.w d0,-(sp)
  37. jsr __exit
  38. L0: bra L0
  39. .sect .data
  40. begdata:
  41. hol0:
  42. .lino:
  43. .data2 0,0 ! lino
  44. .filn:
  45. .data4 0 ! filn
  46. .reghp:
  47. .data4 endbss
  48. .limhp:
  49. .data4 endbss
  50. .trppc:
  51. .data4 0
  52. .trpim:
  53. .data2 0
  54. .sect .bss
  55. begbss: !initialization is not needed because ALL entries are in zero space!