2019-06-15 04:15:30 +10:00
|
|
|
; classic RC2014 setup (8K ROM + 32K RAM) and a stock Serial I/O module
|
|
|
|
; The RAM module is selected on A15, so it has the range 0x8000-0xffff
|
|
|
|
.equ RAMSTART 0x8000
|
|
|
|
.equ RAMEND 0xffff
|
|
|
|
.equ ACIA_CTL 0x80 ; Control and status. RS off.
|
|
|
|
.equ ACIA_IO 0x81 ; Transmit. RS on.
|
|
|
|
|
|
|
|
jp init
|
|
|
|
|
|
|
|
; interrupt hook
|
|
|
|
.fill 0x38-$
|
|
|
|
jp aciaInt
|
|
|
|
|
2019-10-07 05:32:23 +11:00
|
|
|
.inc "err.h"
|
2019-11-14 12:38:06 +11:00
|
|
|
.inc "ascii.h"
|
2019-11-16 07:37:49 +11:00
|
|
|
.inc "blkdev.h"
|
2019-10-07 05:32:23 +11:00
|
|
|
.inc "core.asm"
|
2019-11-15 01:55:31 +11:00
|
|
|
.inc "str.asm"
|
2019-06-15 04:15:30 +10:00
|
|
|
.equ ACIA_RAMSTART RAMSTART
|
2019-10-07 05:32:23 +11:00
|
|
|
.inc "acia.asm"
|
2019-06-15 04:15:30 +10:00
|
|
|
|
|
|
|
.equ MMAP_START 0xd000
|
2019-10-07 05:32:23 +11:00
|
|
|
.inc "mmap.asm"
|
2019-06-15 04:15:30 +10:00
|
|
|
|
|
|
|
.equ BLOCKDEV_RAMSTART ACIA_RAMEND
|
|
|
|
.equ BLOCKDEV_COUNT 1
|
2019-10-07 05:32:23 +11:00
|
|
|
.inc "blockdev.asm"
|
2019-06-15 04:15:30 +10:00
|
|
|
; List of devices
|
2019-10-31 07:59:35 +11:00
|
|
|
.dw mmapGetB, mmapPutB
|
2019-06-15 04:15:30 +10:00
|
|
|
|
|
|
|
.equ STDIO_RAMSTART BLOCKDEV_RAMEND
|
2019-11-05 01:55:12 +11:00
|
|
|
.equ STDIO_GETC aciaGetC
|
|
|
|
.equ STDIO_PUTC aciaPutC
|
2019-10-07 05:32:23 +11:00
|
|
|
.inc "stdio.asm"
|
2019-06-15 04:15:30 +10:00
|
|
|
|
|
|
|
.equ AT28W_RAMSTART STDIO_RAMEND
|
2019-10-07 05:32:23 +11:00
|
|
|
.inc "at28w/main.asm"
|
2019-06-15 04:15:30 +10:00
|
|
|
|
2019-12-03 15:00:35 +11:00
|
|
|
; *** BASIC ***
|
|
|
|
|
|
|
|
; RAM space used in different routines for short term processing.
|
2019-12-13 04:04:56 +11:00
|
|
|
.equ SCRATCHPAD_SIZE STDIO_BUFSIZE
|
2019-12-03 15:00:35 +11:00
|
|
|
.equ SCRATCHPAD AT28W_RAMEND
|
2019-11-16 07:37:49 +11:00
|
|
|
.inc "lib/util.asm"
|
2019-12-03 15:00:35 +11:00
|
|
|
.inc "lib/ari.asm"
|
2019-11-16 07:37:49 +11:00
|
|
|
.inc "lib/parse.asm"
|
2019-12-03 15:00:35 +11:00
|
|
|
.inc "lib/fmt.asm"
|
|
|
|
.equ EXPR_PARSE parseLiteralOrVar
|
|
|
|
.inc "lib/expr.asm"
|
|
|
|
.inc "basic/util.asm"
|
|
|
|
.inc "basic/parse.asm"
|
|
|
|
.inc "basic/tok.asm"
|
|
|
|
.equ VAR_RAMSTART SCRATCHPAD+SCRATCHPAD_SIZE
|
|
|
|
.inc "basic/var.asm"
|
|
|
|
.equ BUF_RAMSTART VAR_RAMEND
|
|
|
|
.inc "basic/buf.asm"
|
|
|
|
.inc "basic/blk.asm"
|
|
|
|
.equ BAS_RAMSTART BUF_RAMEND
|
|
|
|
.inc "basic/main.asm"
|
2019-06-15 04:15:30 +10:00
|
|
|
|
|
|
|
init:
|
|
|
|
di
|
|
|
|
; setup stack
|
2019-12-03 15:00:35 +11:00
|
|
|
ld sp, RAMEND
|
2019-06-15 04:15:30 +10:00
|
|
|
im 1
|
|
|
|
|
|
|
|
call aciaInit
|
|
|
|
xor a
|
|
|
|
ld de, BLOCKDEV_SEL
|
|
|
|
call blkSel
|
|
|
|
|
2019-12-03 15:00:35 +11:00
|
|
|
call basInit
|
|
|
|
ld hl, basFindCmdExtra
|
|
|
|
ld (BAS_FINDHOOK), hl
|
2019-06-15 04:15:30 +10:00
|
|
|
ei
|
2019-12-03 15:00:35 +11:00
|
|
|
jp basStart
|
|
|
|
|
|
|
|
basFindCmdExtra:
|
|
|
|
ld hl, basBLKCmds
|
|
|
|
call basFindCmd
|
|
|
|
ret z
|
|
|
|
ld hl, .mycmds
|
|
|
|
jp basFindCmd
|
|
|
|
.mycmds:
|
|
|
|
.db "at28w", 0
|
|
|
|
.dw at28wMain
|
|
|
|
.db 0xff
|