_bdos.s 698 B

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556
  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 .text
  11. ! Calls a BDOS routine.
  12. .define _cpm_bdos
  13. _cpm_bdos:
  14. push b
  15. lda _cpm_a_register
  16. lhld _cpm_bc_register
  17. mov b, h
  18. mov c, l
  19. lhld _cpm_de_register
  20. mov d, h
  21. mov e, l
  22. lhld _cpm_hl_register
  23. call 5
  24. shld _cpm_hl_register
  25. mov h, d
  26. mov l, e
  27. shld _cpm_de_register
  28. mov h, b
  29. mov l, c
  30. shld _cpm_bc_register
  31. sta _cpm_a_register
  32. pop b
  33. ret
  34. .sect .bss
  35. .define _cpm_a_register, _cpm_bc_register, _cpm_de_register, _cpm_hl_register
  36. .comm _cpm_a_register, 1
  37. .comm _cpm_bc_register, 2
  38. .comm _cpm_de_register, 2
  39. .comm _cpm_hl_register, 2