From 6c0f888b073c4f28f95bd1cc961c757ea8543a88 Mon Sep 17 00:00:00 2001 From: Joshua Bell Date: Mon, 7 Jan 2019 19:36:25 -0800 Subject: [PATCH] wip --- .gitignore | 1 + Makefile | 2 +- bell.s | 9 +++++++++ hello.s | 18 ++++++++++++++++++ path.s | 19 ++++++++++++++----- 5 files changed, 43 insertions(+), 6 deletions(-) create mode 100644 .gitignore create mode 100644 bell.s create mode 100644 hello.s diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..1fcb152 --- /dev/null +++ b/.gitignore @@ -0,0 +1 @@ +out diff --git a/Makefile b/Makefile index 1be90fb..140fe68 100644 --- a/Makefile +++ b/Makefile @@ -5,7 +5,7 @@ CCFLAGS = --config apple2-asm.cfg OUTDIR = out -TARGETS = $(OUTDIR)/path.BIN +TARGETS = $(OUTDIR)/path.BIN $(OUTDIR)/bell.CMD $(OUTDIR)/hello.CMD .PHONY: clean all all: $(OUTDIR) $(TARGETS) diff --git a/bell.s b/bell.s new file mode 100644 index 0000000..020be2d --- /dev/null +++ b/bell.s @@ -0,0 +1,9 @@ + + .include "apple2.inc" + +BELL := $FBE4 + + .org $4000 + + jsr BELL + rts diff --git a/hello.s b/hello.s new file mode 100644 index 0000000..8c06bb0 --- /dev/null +++ b/hello.s @@ -0,0 +1,18 @@ + + .include "apple2.inc" + +CROUT := $FD8E +COUT := $FDED + + .org $4000 + + ldx #0 +: lda str, x + beq done + jsr COUT + jmp :- + +done: jsr CROUT + rts + +str: .byte "Hello, world!", 0 \ No newline at end of file diff --git a/path.s b/path.s index 1fb25d5..36e4050 100644 --- a/path.s +++ b/path.s @@ -13,14 +13,26 @@ .include "prodos.inc" ;;; ============================================================ +;;; +;;; Installed command memory structure: +;;; * 2 pages - code, path buffer +;;; * 2 pages - I/O buffer -INBUF := $200 ; GETLN input buffer +;;; TODO: +;;; * Dynamically allocate I/O buffer +;;; * Support multi-segment path (e.g. /hd/bin:/hd/extras/bin +;;; * Fail install if on an Integer BASIC machine +;;; * Skip leading spaces + +;;; ============================================================ cmd_load_addr := $4000 max_cmd_size = $2000 ;;; ============================================================ -;;; Monitor ROM routines +;;; Monitor ROM routines/locations + +INBUF := $200 ; GETLN input buffer CROUT := $FD8E COUT := $FDED @@ -30,7 +42,6 @@ MOVE_SRC := $3C MOVE_END := $3E MOVE_DST := $42 - TOKEN_NAME_TABLE := $D0D0 CASE_MASK = $DF @@ -41,8 +52,6 @@ CASE_MASK = $DF .proc installer ptr := $06 - ;; TODO: Fail if Applesoft is not in ROM - ;; Save previous external command address lda EXTRNCMD+1 sta next_command