cpm.h 1.5 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667
  1. /*
  2. * unistd.h - standard system calls
  3. */
  4. /* $Id$ */
  5. #ifndef _CPM_H
  6. #define _CPM_H
  7. #include <stdint.h>
  8. /* These interface provides a very bare-bones interface to the CP/M BDOS. Set
  9. * the following four variables as you wish, call cpm_bdos(), and the contents
  10. * of the variables will have been updated accordingly. */
  11. extern uint8_t cpm_a_register;
  12. extern uint16_t cpm_bc_register;
  13. extern uint16_t cpm_de_register;
  14. extern uint16_t cpm_hl_register;
  15. extern void cpm_bdos(void);
  16. /* Describes the available CP/M BDOS calls. They're a fairly conservative set
  17. * taken from the CP/M 2.0 manual. */
  18. enum
  19. {
  20. CPM_BDOS_SYSTEM_RESET,
  21. CPM_BDOS_CONSOLE_INPUT,
  22. CPM_BDOS_CONSOLE_OUTPUT,
  23. CPM_BDOS_READER_INPUT,
  24. CPM_BDOS_PUNCH_OUTPUT,
  25. CPM_BDOS_LIST_OUTPUT,
  26. CPM_BDOS_CONSOLE_IO,
  27. CPM_BDOS_GET_IO_BYTE,
  28. CPM_BDOS_SET_IO_BYTE,
  29. CPM_BDOS_PRINT_STRING,
  30. CPM_BDOS_READ_CONSOLE_BUFFER,
  31. CPM_BDOS_GET_CONSOLE_STATUS,
  32. CPM_BDOS_GET_VERSION_NUMBER,
  33. CPM_BDOS_RESET_DISK_SYSTEM,
  34. CPM_BDOS_SELECT_DISK,
  35. CPM_BDOS_OPEN_FILE,
  36. CPM_BDOS_CLOSE_FILE,
  37. CPM_BDOS_SEARCHFIRST,
  38. CPM_BDOS_SEARCHNEXT,
  39. CPM_BDOS_DELETE_FILE,
  40. CPM_BDOS_READ_SEQ,
  41. CPM_BDOS_WRITE_SEQ,
  42. CPM_BDOS_MAKE_FILE,
  43. CPM_BDOS_RENAME_FILE,
  44. CPM_BDOS_GET_LOGIN_VECTOR,
  45. CPM_BDOS_GET_CURRENT_DISK,
  46. CPM_BDOS_SET_DMA_ADDRESS,
  47. CPM_BDOS_GET_ALLOC_VECTOR,
  48. CPM_BDOS_WRITE_PROTECT,
  49. CPM_BDOS_GET_RO_VECTOR,
  50. CPM_BDOS_SET_FILE_ATTR,
  51. CPM_BDOS_GET_DISK_PARMS,
  52. CPM_BDOS_SETGET_USER,
  53. CPM_BDOS_READ_RANDOM,
  54. CPM_BDOS_WRITE_RANDOM,
  55. CPM_BDOS_GET_FILE_SIZE,
  56. CPM_BDOS_SET_RANDOM
  57. };
  58. #endif