Skip to content

Z80 port (cleaned up version)#12

Open
nickd4 wants to merge 41 commits intouho:masterfrom
nickd4:z80_port1
Open

Z80 port (cleaned up version)#12
nickd4 wants to merge 41 commits intouho:masterfrom
nickd4:z80_port1

Conversation

@nickd4
Copy link

@nickd4 nickd4 commented Apr 27, 2022

In this change I have split the /preForth directory into /common and /i386 and I have also split some of the Forth sources into bit-width depedent and/or direct/indirect threaded dependent files. So in the /common directory we now have

  • hi16bit.forth
  • hi32bit.forth
  • seedForth16bit.pre
  • seedForth32bit.pre

and these are prefixed to the similarly named files hi.forth and seedForth.pre to set the minint and maxint values, whereas in the /i386 directory we now have

  • seedForth-i386.pre
  • seedForthRuntimei386.seedsource

and these are suffixed to seedForth-i386-rts.pre and seedForthRuntime.seedsource respectively to define some critical words implement the compiler or does> system, allowing us to insert call instructions for direct threaded and so forth.

And then I have added the following new directories:

  • /asxv5pxx contains a local copy of the GPLv3-licensed ASxxxx assemblers, (as a submodule that references my nick4 account on github), for bootstrapping. See https://shop-pdp.net/ashtml/asxxxx.php for the original source of these files.
  • /emu_z80 contains a local copy of the MIT-licensed Z80 emulator at https://github.com/superzazu/z80 (as a submodule that references my nickd4 account on github), and a wrapper that t I developed to provide preForth-compatible I/O facilities.
  • /z80 contains a copy of the /i386 directory with appropriate changes: fasm i386 source changed to asz80 source, Makefile changed to build bin files and run via the emulator, 32-bit changed to 16-bit, indirect threaded changed to direct.

You can run ./seed and ./seedForth-tokenizer in the /z80 directory and they work pretty much the way they do in /i386.

…to bss rather than text section which avoids the need to call mprotect(), rename things
… be wrapped with PROGRAM / END, also removes automatic bye token that was generated by END
…time.seedsource, so that we can run textual forth code without the tests or the banner
… writes to stderr, fix self-hosted tokenizer termination issue (was debugged with eemit)
…ng the nonstandard words on top of gForth's standard words, produces redefinition warnings
…seedForth-i386.pre containing some compiler words so we can do special handling for DTC
This was referenced May 1, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants