boot.s 1.3 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667
  1. #
  2. ! $Source$
  3. ! $State$
  4. ! $Revision$
  5. ! Declare segments (the order is important).
  6. .sect .text
  7. .sect .rom
  8. .sect .data
  9. .sect .bss
  10. .sect .bss
  11. STACKSIZE = 2*1024
  12. .comm stack, STACKSIZE
  13. .comm oldstack, 2
  14. .sect .text
  15. begtext:
  16. lxi sp, oldstack + STACKSIZE
  17. lxi h, 0
  18. push h
  19. push h
  20. push h
  21. call __m_a_i_n
  22. jmp EXIT
  23. ! Emergency exit routine.
  24. .define EXIT, __exit
  25. EXIT:
  26. __exit:
  27. rst 0
  28. ! Define symbols at the beginning of our various segments, so that we can find
  29. ! them. (Except .text, which has already been done.)
  30. .define begtext, begdata, begbss
  31. .sect .data; begdata:
  32. .sect .rom; begrom:
  33. .sect .bss; begbss:
  34. ! Some magic data. All EM systems need these.
  35. .define .trppc, .ignmask, _errno
  36. .comm .trppc, 2
  37. .comm .ignmask, 2
  38. .comm _errno, 2
  39. ! These are used specifically by the CP/M port.
  40. .define .trapproc, .retadr, .retadr1
  41. .define .bcreg, .areg
  42. .define .tmp1, .fra, block1, block2, block3
  43. .comm .trapproc, 2
  44. .comm .retadr, 2 ! used to save return address
  45. .comm .retadr1, 2 ! reserve
  46. .comm .bcreg, 2
  47. .comm .areg, 1
  48. .comm .tmp1, 2
  49. .comm .fra, 8 ! 8 bytes function return area
  50. block1: .space 4 ! used by 32 bits divide and
  51. block2: .space 4 ! multiply routines
  52. block3: .space 4 ! must be contiguous (.comm doesn't guarantee this)