Mirror of CollapseOS
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

115 line
2.0KB

  1. ; classic RC2014 setup (8K ROM + 32K RAM) and a stock Serial I/O module
  2. ; The RAM module is selected on A15, so it has the range 0x8000-0xffff
  3. .equ RAMSTART 0x8000
  4. .equ RAMEND 0xffff
  5. .equ ACIA_CTL 0x80 ; Control and status. RS off.
  6. .equ ACIA_IO 0x81 ; Transmit. RS on.
  7. .equ USER_CODE 0xa000
  8. jp init ; 3 bytes
  9. ; *** Jump Table ***
  10. jp printstr
  11. jp sdcWaitResp
  12. jp sdcCmd
  13. jp sdcCmdR1
  14. jp sdcCmdR7
  15. jp sdcSendRecv
  16. ; interrupt hook
  17. .fill 0x38-$
  18. jp aciaInt
  19. .inc "err.h"
  20. .inc "ascii.h"
  21. .inc "blkdev.h"
  22. .inc "fs.h"
  23. .inc "core.asm"
  24. .inc "str.asm"
  25. .equ ACIA_RAMSTART RAMSTART
  26. .inc "acia.asm"
  27. .equ BLOCKDEV_RAMSTART ACIA_RAMEND
  28. .equ BLOCKDEV_COUNT 2
  29. .inc "blockdev.asm"
  30. ; List of devices
  31. .dw sdcGetB, sdcPutB
  32. .dw blk2GetB, blk2PutB
  33. .equ STDIO_RAMSTART BLOCKDEV_RAMEND
  34. .equ STDIO_GETC aciaGetC
  35. .equ STDIO_PUTC aciaPutC
  36. .inc "stdio.asm"
  37. .equ FS_RAMSTART STDIO_RAMEND
  38. .equ FS_HANDLE_COUNT 1
  39. .inc "fs.asm"
  40. ; *** BASIC ***
  41. ; RAM space used in different routines for short term processing.
  42. .equ SCRATCHPAD_SIZE STDIO_BUFSIZE
  43. .equ SCRATCHPAD FS_RAMEND
  44. .inc "lib/util.asm"
  45. .inc "lib/ari.asm"
  46. .inc "lib/parse.asm"
  47. .inc "lib/fmt.asm"
  48. .equ EXPR_PARSE parseLiteralOrVar
  49. .inc "lib/expr.asm"
  50. .inc "basic/util.asm"
  51. .inc "basic/parse.asm"
  52. .inc "basic/tok.asm"
  53. .equ VAR_RAMSTART SCRATCHPAD+SCRATCHPAD_SIZE
  54. .inc "basic/var.asm"
  55. .equ BUF_RAMSTART VAR_RAMEND
  56. .inc "basic/buf.asm"
  57. .inc "basic/blk.asm"
  58. .inc "basic/sdc.asm"
  59. .equ BFS_RAMSTART BUF_RAMEND
  60. .inc "basic/fs.asm"
  61. .equ BAS_RAMSTART BFS_RAMEND
  62. .inc "basic/main.asm"
  63. .equ SDC_RAMSTART BAS_RAMEND
  64. .equ SDC_PORT_CSHIGH 6
  65. .equ SDC_PORT_CSLOW 5
  66. .equ SDC_PORT_SPI 4
  67. .inc "sdc.asm"
  68. init:
  69. di
  70. ld sp, RAMEND
  71. im 1
  72. call aciaInit
  73. call fsInit
  74. call basInit
  75. ld hl, basFindCmdExtra
  76. ld (BAS_FINDHOOK), hl
  77. xor a
  78. ld de, BLOCKDEV_SEL
  79. call blkSel
  80. ei
  81. jp basStart
  82. basFindCmdExtra:
  83. ld hl, basFSCmds
  84. call basFindCmd
  85. ret z
  86. ld hl, basBLKCmds
  87. call basFindCmd
  88. ret z
  89. ld hl, basSDCCmds
  90. jp basFindCmd
  91. ; *** blkdev 2: file handle 0 ***
  92. blk2GetB:
  93. ld ix, FS_HANDLES
  94. jp fsGetB
  95. blk2PutB:
  96. ld ix, FS_HANDLES
  97. jp fsPutB