From 31119c2de3ac2f74f8b3fb6d3c85561a01ebc359 Mon Sep 17 00:00:00 2001 From: Virgil Dupras Date: Tue, 5 May 2020 20:10:04 -0400 Subject: [PATCH] xcomp: move all offset spitting to the end of the unit I'd like to move this code, along with all recipe contents, to blk/. It's easier if "emul-related" code is gathered at the same place. --- emul/xcomp.fs | 2 +- recipes/rc2014/selfhost/README.md | 7 +++---- recipes/rc2014/xcomp.fs | 2 +- recipes/trs80/xcomp.fs | 2 +- 4 files changed, 6 insertions(+), 7 deletions(-) diff --git a/emul/xcomp.fs b/emul/xcomp.fs index dced41e..0deddca 100644 --- a/emul/xcomp.fs +++ b/emul/xcomp.fs @@ -9,7 +9,6 @@ CURRENT @ XCURRENT ! -H@ 256 /MOD 2 PC! 2 PC! 282 LOAD ( boot.z80 ) 393 LOAD ( icore ) (entry) _ @@ -19,4 +18,5 @@ PC ORG @ 8 + ! ," : (emit) 0 PC! ; : (key) 0 PC@ ; " 422 459 XPACKR ," ' (key) 12 RAM+ ! " +ORG @ 256 /MOD 2 PC! 2 PC! H@ 256 /MOD 2 PC! 2 PC! diff --git a/recipes/rc2014/selfhost/README.md b/recipes/rc2014/selfhost/README.md index e190392..7137b8d 100644 --- a/recipes/rc2014/selfhost/README.md +++ b/recipes/rc2014/selfhost/README.md @@ -17,7 +17,7 @@ it from the makefile. If you take the time to look at the base recipe `xcomp.fs` in a text editor and take a look at it. To assemble stage 1 from RC2014, all you need to do is to type those commands -in the same order, and replace the `H@ 256 /MOD 2 PC! 2 PC!` lines with `H@ .X`. +in the same order, and replace the `/MOD 2 PC! 2 PC!` words with `.X`. Those commands will inform you of the begin/end offsets of the assembled binary. I'm not going to explain in detail what each command do, but only give you an @@ -33,9 +33,8 @@ we'll of course need for the task ahead. Then come xcomp overrides, which are needed for xcomp to be effective. -At this point, we're about to begin spitting binary content, so we want to know -where we're at. That's why you'll need to type `H@ .X` and write down the -result. That's the starting offset. +At this point, we're about to begin spitting binary content, this will be our +starting offset. `ORG` will soon be set to your current `H@`. Then, we assemble the boot binary, drivers' native words, then inner core, close the binary with a hook word. We're finished with cross-compiling. diff --git a/recipes/rc2014/xcomp.fs b/recipes/rc2014/xcomp.fs index 87271db..dc34efb 100644 --- a/recipes/rc2014/xcomp.fs +++ b/recipes/rc2014/xcomp.fs @@ -15,7 +15,6 @@ RAMSTART 0x70 + CONSTANT ACIA_MEM CURRENT @ XCURRENT ! -H@ 256 /MOD 2 PC! 2 PC! 282 LOAD ( boot.z80 ) 352 LOAD ( acia.z80 ) 372 LOAD ( sdc.z80 ) @@ -28,4 +27,5 @@ PC ORG @ 8 + ! 438 452 XPACKR ( print fmt readln ) 123 132 XPACKR ( linker ) ," : _ ACIA$ RDLN$ (ok) ; _ " +ORG @ 256 /MOD 2 PC! 2 PC! H@ 256 /MOD 2 PC! 2 PC! diff --git a/recipes/trs80/xcomp.fs b/recipes/trs80/xcomp.fs index 71d8056..42001cb 100644 --- a/recipes/trs80/xcomp.fs +++ b/recipes/trs80/xcomp.fs @@ -9,7 +9,6 @@ RS_ADDR 0x80 - CONSTANT RAMSTART CURRENT @ XCURRENT ! -H@ 256 /MOD 2 PC! 2 PC! 0x3000 BIN( ! 282 LOAD ( boot.z80 ) 492 LOAD ( trs80.z80 ) @@ -22,4 +21,5 @@ PC ORG @ 8 + ! 499 500 XPACKR ( trs80.fs ) ( 0x0a == NLPTR. TRS-80 wants CR-only newlines ) ," : _ ['] CR 0x0a RAM+ ! BLK$ FD$ (ok) RDLN$ ; _ " +ORG @ 256 /MOD 2 PC! 2 PC! H@ 256 /MOD 2 PC! 2 PC!