From cf2f6703bb45ef229419130f9194d0c168b2715b Mon Sep 17 00:00:00 2001 From: Virgil Dupras Date: Thu, 26 Mar 2020 12:17:02 -0400 Subject: [PATCH] forth: make forth/forth.asm spit whole binary emul/forth/stage{0,1}.asm now only configure constants and append binaries. --- emul/forth/stage0.asm | 2 -- emul/forth/stage1.asm | 2 -- emul/forth/stagec.asm | 7 ------- forth/forth.asm | 10 +++------- 4 files changed, 3 insertions(+), 18 deletions(-) diff --git a/emul/forth/stage0.asm b/emul/forth/stage0.asm index 4679133..c896d1f 100644 --- a/emul/forth/stage0.asm +++ b/emul/forth/stage0.asm @@ -1,5 +1,3 @@ - jp init - .inc "stagec.asm" .inc "forth.asm" diff --git a/emul/forth/stage1.asm b/emul/forth/stage1.asm index 539aa9e..56de03d 100644 --- a/emul/forth/stage1.asm +++ b/emul/forth/stage1.asm @@ -1,5 +1,3 @@ - jp init - .inc "stagec.asm" .inc "forth.asm" diff --git a/emul/forth/stagec.asm b/emul/forth/stagec.asm index b146d21..9beac71 100644 --- a/emul/forth/stagec.asm +++ b/emul/forth/stagec.asm @@ -2,10 +2,3 @@ .equ HERE_INITIAL CODE_END ; override .equ LATEST CODE_END ; override .equ STDIO_PORT 0x00 - -init: - di - ; setup stack - ld sp, 0xffff - call forthMain - halt diff --git a/forth/forth.asm b/forth/forth.asm index f38889d..1e28724 100644 --- a/forth/forth.asm +++ b/forth/forth.asm @@ -103,6 +103,8 @@ ; *** Stable ABI *** ; Those jumps below are supposed to stay at these offsets, always. If they ; change bootstrap binaries have to be adjusted because they rely on them. +; We're at 0 here + jp forthMain .fill 0x17-$ JUMPTBL: jp nativeWord @@ -683,13 +685,7 @@ abortUnderflow: .db 3 BYE: .dw nativeWord - ; Goodbye Forth! Before we go, let's restore the stack - ld sp, (INITIAL_SP) - ; unwind stack underflow buffer - pop af \ pop af \ pop af - ; success - xor a - ret + halt ; ( c -- ) .db "EMIT"