Conversation
5d89be2 to
4cc2356
Compare
mkobetic
commented
Mar 26, 2026
| @@ -66,15 +66,6 @@ The DEBUG register is controlled through the USER variable `debug.next`, which d | |||
| # then | |||
| # ; | |||
| # | |||
Owner
Author
There was a problem hiding this comment.
moving this to new words/output.s so that the transpiler does not depend on debugger.
mkobetic
commented
Mar 26, 2026
| IMMED "until", UNTIL /* ( f -- )(C: a -- ) if f is true jump back to begin, otherwise leave the loop */ | ||
| .word XT_QNOP | ||
| .word XT_DOLITERAL | ||
| .word XT_COMPILE |
Owner
Author
There was a problem hiding this comment.
This should use COMPILE like everything else, this way we don't have to do anything special for TPILE to handle until.
d22732c to
f30ed32
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Basic idea is to emit a stream of tokens during normal compilation that should be relatively easy to transform into actual ITC code (by amforth-shell) given the list of known XT addresses (read from the symbol table). The example below shows the interaction between amshell and amforth compiling word
fibfollowed by the transpiled result emitted by amshell:Transpiler should be able to handle most words with few exceptions like
:noname,<builds does>orpostpone. Full list is maintained in the comment oftpile.s.The
amforth-shellside handles the transcription into ITC, it emits the ITC along the original Forth line (as a comment). It follows the offsets of the original lines to offset the ITC code. It collects the continuous block of comments before the word and emits it as a long description /* */ block comment after the ITC word header. Similarly it parses the line that starts the word definition to look for stack signature and following short description to emit with the ITC header, to be used in the refcard tables.Here's a sample original with comments and the resulting ITC
The transpiler can be compiled in or out with
WANT_TRANSPILERconfig option. Amshell will report an error if #transpile is used without transpiler being available on the target.