From 4b7247a971c281cc85891de3eec6639d3be06b02 Mon Sep 17 00:00:00 2001 From: Virgil Dupras Date: Sun, 26 Apr 2020 08:37:12 -0400 Subject: [PATCH] emul: use LATEST instead of binary size as start addr in stage More reliable. --- emul/stage.c | 4 +++- emul/stage1.fs | 1 - 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/emul/stage.c b/emul/stage.c index 2e7d7ba..b6cef1d 100644 --- a/emul/stage.c +++ b/emul/stage.c @@ -113,7 +113,9 @@ int main(int argc, char *argv[]) #ifndef DEBUG // We're done, now let's spit dict data if (start_here == 0) { - start_here = sizeof(KERNEL); + // No starting offset? Let's use LATEST + start_here = m->mem[0x08]; + start_here += m->mem[0x09] << 8; } for (int i=start_here; imem[i]); diff --git a/emul/stage1.fs b/emul/stage1.fs index cf391dd..a2ab67d 100644 --- a/emul/stage1.fs +++ b/emul/stage1.fs @@ -1,5 +1,4 @@ CURRENT @ HERE ! -HERE @ 256 /MOD 2 PC! 2 PC! : EMIT 0 PC! ; : KEY 0 PC@ ; CURRENT @ 12 RAM+ !