Use zasm in recipes

This commit is contained in:
Virgil Dupras 2019-05-20 11:00:14 -04:00
parent c40bc329d5
commit ed19c6afc1
7 changed files with 42 additions and 44 deletions

View File

@ -1,7 +1,7 @@
TARGET = os.bin
PARTS = ../../parts/z80
ZASM = ../../tools/emul/zasm/zasm
.PHONY: all
all: $(TARGET)
$(TARGET): glue.asm
scas -o $@ -L map -I $(PARTS) $<
$(ZASM) < $< > $@

View File

@ -38,8 +38,7 @@ device I use in this recipe.
### Gathering parts
* Collapse OS parts in `/path/to/parts`
* [scas][scas]
* [zasm][zasm]
* [romwrite][romwrite] and its specified dependencies
* [GNU screen][screen]
* A FTDI-to-TTL cable to connect to the Serial I/O module of the RC2014
@ -75,7 +74,7 @@ is decoupled from the ACIA and can get its IO from anything. See
We only have the shell to build, so it's rather straightforward:
scas -I /path/to/parts -o rom.bin glue.asm
zasm < glue.asm > rom.bin
### Write to the ROM
@ -104,5 +103,5 @@ TODO
[rc2014]: https://rc2014.co.uk
[romwrite]: https://github.com/hsoft/romwrite
[scas]: https://github.com/KnightOS/scas
[zasm]: ../../tools/emul
[screen]: https://www.gnu.org/software/screen/

View File

@ -1,9 +1,9 @@
; 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
RAMSTART .equ 0x8000
RAMEND .equ 0xffff
ACIA_CTL .equ 0x80 ; Control and status. RS off.
ACIA_IO .equ 0x81 ; Transmit. RS on.
.equ RAMSTART 0x8000
.equ RAMEND 0xffff
.equ ACIA_CTL 0x80 ; Control and status. RS off.
.equ ACIA_IO 0x81 ; Transmit. RS on.
jp init
@ -13,20 +13,20 @@ jp aciaInt
#include "core.asm"
#include "parse.asm"
ACIA_RAMSTART .equ RAMSTART
.equ ACIA_RAMSTART RAMSTART
#include "acia.asm"
BLOCKDEV_RAMSTART .equ ACIA_RAMEND
BLOCKDEV_COUNT .equ 1
.equ BLOCKDEV_RAMSTART ACIA_RAMEND
.equ BLOCKDEV_COUNT 1
#include "blockdev.asm"
; List of devices
.dw aciaGetC, aciaPutC, 0, 0
STDIO_RAMSTART .equ BLOCKDEV_RAMEND
.equ STDIO_RAMSTART BLOCKDEV_RAMEND
#include "stdio.asm"
SHELL_RAMSTART .equ STDIO_RAMEND
SHELL_EXTRA_CMD_COUNT .equ 0
.equ SHELL_RAMSTART STDIO_RAMEND
.equ SHELL_EXTRA_CMD_COUNT 0
#include "shell.asm"
init:

View File

@ -1,9 +1,9 @@
TARGETS = os.bin sdinit.bin
PARTS = ../../../parts/z80
ZASM = ../../../tools/emul/zasm/zasm
.PHONY: all
all: $(TARGETS)
os.bin: glue.asm
sdinit.bin: sdinit.asm
$(TARGETS):
scas -o $@ -L map -I $(PARTS) $<
$(ZASM) < $< > $@

View File

@ -1,9 +1,9 @@
; 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
RAMSTART .equ 0x8000
RAMEND .equ 0xffff
ACIA_CTL .equ 0x80 ; Control and status. RS off.
ACIA_IO .equ 0x81 ; Transmit. RS on.
.equ RAMSTART 0x8000
.equ RAMEND 0xffff
.equ ACIA_CTL 0x80 ; Control and status. RS off.
.equ ACIA_IO 0x81 ; Transmit. RS on.
jp init
@ -26,10 +26,10 @@ jp aciaInt
#include "core.asm"
#include "parse.asm"
ACIA_RAMSTART .equ RAMSTART
.equ ACIA_RAMSTART RAMSTART
#include "acia.asm"
BLOCKDEV_RAMSTART .equ ACIA_RAMEND
BLOCKDEV_COUNT .equ 2
.equ BLOCKDEV_RAMSTART ACIA_RAMEND
.equ BLOCKDEV_COUNT 2
#include "blockdev.asm"
; List of devices
.dw aciaGetC, aciaPutC, 0, 0
@ -37,11 +37,11 @@ BLOCKDEV_COUNT .equ 2
#include "blockdev_cmds.asm"
STDIO_RAMSTART .equ BLOCKDEV_RAMEND
.equ STDIO_RAMSTART BLOCKDEV_RAMEND
#include "stdio.asm"
SHELL_RAMSTART .equ STDIO_RAMEND
SHELL_EXTRA_CMD_COUNT .equ 3
.equ SHELL_RAMSTART STDIO_RAMEND
.equ SHELL_EXTRA_CMD_COUNT 3
#include "shell.asm"
.dw sdcInitializeCmd, blkBselCmd, blkSeekCmd

View File

@ -1,11 +0,0 @@
JUMP_PRINTSTR .equ 0x03
JUMP_PRINTHEX .equ 0x06
JUMP_SDCINITALIZE .equ 0x09
JUMP_SDCSENDRECV .equ 0x0c
JUMP_SDCWAITRESP .equ 0x0f
JUMP_SDCCMD .equ 0x12
JUMP_SDCCMDR1 .equ 0x15
JUMP_SDCCMDR7 .equ 0x18
JUMP_SDCREAD .equ 0x1b
JUMP_SDCSETBLKSIZE .equ 0x1e

View File

@ -1,16 +1,25 @@
#include "jumptable.inc"
.equ JUMP_PRINTSTR 0x03
.equ JUMP_PRINTHEX 0x06
.equ JUMP_SDCINITALIZE 0x09
.equ JUMP_SDCSENDRECV 0x0c
.equ JUMP_SDCWAITRESP 0x0f
.equ JUMP_SDCCMD 0x12
.equ JUMP_SDCCMDR1 0x15
.equ JUMP_SDCCMDR7 0x18
.equ JUMP_SDCREAD 0x1b
.equ JUMP_SDCSETBLKSIZE 0x1e
.org 0x9000
call JUMP_SDCINITALIZE
or a
jp nz, .error
jp nz, error
ld hl, sOk
call JUMP_PRINTSTR
call JUMP_SDCSETBLKSIZE
or a
jp nz, .error
jp nz, error
ld hl, sOk
call JUMP_PRINTSTR
@ -19,7 +28,7 @@
xor a
call JUMP_SDCREAD
or a
jp nz, .error
jp nz, error
push hl
ld hl, sOk
@ -30,7 +39,8 @@
call JUMP_PRINTSTR
ret
.error:
error:
call JUMP_PRINTHEX
ld hl, sErr
call JUMP_PRINTSTR