summary refs log tree commit diff
AgeCommit message (Collapse)Author
8 daysprint an error message when there's no wordIrene Knapp
Force-Push: yes Change-Id: I2c7eb0c842c930be17bdff2d0e270c53fb996f86
9 daysand now it can lex Forth code!Irene Knapp
well, sort of. no literals yet. Force-Push: yessssssss!!! Change-Id: I91156554934659ea285cf18def5ed66ce09a1171
10 daysimplement "key", which reads a byte of input from the bufferIrene Knapp
sweeeeeeeet nearly there now also, fetch8 (aka 8@) and the 16- and 32-bit equivalents never actually returned their results. oops. fixed. Force-Push: yes Change-Id: I35e48036951e829625cc37ce99d789e97d98100b
12 dayssome stuff for dealing with circular buffers, implemented as heap wordsIrene Knapp
by putting this directly on the heap, we allow it to work in the easy, obvious ways, at the cost of extreme verbosity. the core abstractions here are "buffer", "input buffer", and "buffer metadata". the metadata struct is distinct from the backing store, though there is a convenience word to allocate them together. for communication purposes, the buffer "is" the metadata struct, and the "backing store" is where things are actually read from. all input buffers are buffers but someday not all buffers will be input buffers; note carefully how the various word names make this distinction. Force-Push: yes Change-Id: Ib85a74af046b42c8959c6edf93b83e2ad7f21be4
2026-04-13implement all the remaining Forth words that need flatassembler versionsIrene Knapp
wow!!!!! the next step is implementing the Forth lexer. wow! Force-Push: yes Change-Id: If847c1d7b3949f7d449279e0783021484f96e6a8
2026-04-13fix more Forth-assembly wordsIrene Knapp
the words that needed fixes were unroll, stringlen, 0branch, and sys-exit this is now everything that's expected to agree, we're pretty sure the disassemblies of litpack* contain absolute addresses of the corresponding pack* words, so those are expected to be different, and the differences look correct at the byte level similarly, the implementation of docol is significantly different structurally and that's also expected Force-Push: yes Change-Id: I0028fb00b4ce51a7f7c608a3153323cf4a2e5a25
2026-04-13the heap definition of roll was wrongIrene Knapp
it somehow messed up the call to mov_indirect_reg64_reg64. probably a copy-paste error. Force-Push: yes Change-Id: Iaaf70b4d135d101114d07fd7efa7de3736522aa8
2026-04-13same problem with cmp_reg64_reg64Irene Knapp
this one didn't have any invocations that were themselves incorrect and it's really nice to be confident of THAT, too Force-Push: yes Change-Id: Ia3fcb373653971bc10d31b2622765d9e16f89845
2026-04-13fix argument order to sub_reg64_reg64Irene Knapp
it was backwards compared to sub.qreg.qreg, and the mistake had been missed because frankly that's kind of confusing and most of the invocations of it were themselves backwards, cancelling it out Force-Push: yes Change-Id: I54bfa242428fcbe54edc9bc1de8199ec9e821ef7
2026-04-13disallow a target of rbp for indirect register moves via flatassemblerIrene Knapp
this matches the behavior the Forth implementation has, and also the behavior of the other flatassembler moves. those versions were written later; it became obvious over the course of development that transparently remapping one variant of an instruction into another was a bad idea and would cause confusion. this change is happening now because, indeed, it caused confusion. the offending variant was used exactly once, in the pushcontrol macro. it has been changed to the disp8 version, which is already what was being output. we've carefully verified that this produces no unexpected binary changes either to the ELF or to the heap. it's kinda cool knowing for sure that the debugging process actually catches this sort of weirdness. Force-Push: yes Change-Id: I355fc0070bb95beeb94c7d14d46fa2cc50f3a30d
2026-04-13fix some disagreements with the heap words implemented in ForthIrene Knapp
there's still pending disagreements with words implemented in assembly, which will be dealt with in another CL "forthcoming" :D Force-Push: yes Change-Id: I5420f79365bb1de4ff8e30d79212788251f871cf
2026-04-13add 2drop to describe-data.sedIrene Knapp
oops. missed this one, since it's never actually called so it showed up differently in the diff. Force-Push: yes Change-Id: Ia07b268ab736d06aa7d374654dd97baf14f84e1c
2026-04-13add another sed script, to remove absolute addressesIrene Knapp
this is useful for a different type of comparison Force-Push: yes Change-Id: I225af22586924a716c0d0802cda5194fd19d7d12
2026-04-13add some sed scripts to make the output easier to examineIrene Knapp
these separate out the data and heap segments; the one for the data segment also replaces all the flatassembler names with Forth names. the output of these scripts looks very clean when passed through diff, showing only important differences Force-Push: yes Change-Id: I868ca9817fa41d2c503a8480ae6ceb44c9e10df7
2026-04-13tweak how the spaces around "describe" are printedIrene Knapp
there had been trailing spaces in the output; now there aren't. happily, since this was just rearranging existing code snippets, there was no need to recalculate those fiddly branch offsets. Force-Push: yes Change-Id: Ifde20e2f8e405da3d74175fd029d589eb0a1ecc0
2026-04-13fix "describe" to work on both data segment and heapIrene Knapp
the hard part was figuring out the generic test for docol. it doesn't really test for docol, it tests for self-codewords and treats everything else as if it uses docol... not ideal, but good enough for now this also involved hardcoding the name "0branch" as an alternative to "zbranch". again, not a long-term strategy, but the long-term strategy is to remove flatassembler entirely, at which point the old names will go away because we'll be using our own lexer. there were also a couple small code-validity things that either broke the "describe" output, or became evident because of it, which are now fixed as well. Force-Push: yes Change-Id: If6641bb27f4fb0308f6fd4a2f4885215187ec8d9
2026-04-13stop heap implementations from referencing the data segmentIrene Knapp
there were a few places where this was inadvertently happening, mostly due to using the wrong name for things this should be all of them, based on searching the debug output for references to the wrong memory area Force-Push: yes Change-Id: I2023e3986f6ab15ff394cca759af3cb98c8ee923
2026-04-12add heap implementations of all remaining Forth-assembly instructionsIrene Knapp
also there was some missing string termination in the previous ones Force-Push: yes Change-Id: I8aebc8569a99a7534ffa3e457020327c3e124ddd
2026-04-11add heap implementations of the string instructionsIrene Knapp
Force-Push: yes Change-Id: I15fcae09a0bd0f722c339ed2df41764c8fd9fa7e
2026-04-09add more MOV variants (oops), also some more instructionsIrene Knapp
Force-Push: yes Change-Id: I7cd521188642c63820f3b71c8bd1faf532b6962d
2026-04-09implement heap versions of all the Forth assembly MOV variantsIrene Knapp
Force-Push: yes Change-Id: I9f39c4ea6b46f349cc79dcd9fbc96ed7d546bc8d
2026-04-09implement heap versions of the addressing-mode helper wordsIrene Knapp
Force-Push: yes Change-Id: I8a3362131086291f60f5f68369e819c1c030babb
2026-04-09implement all the assembly enumsIrene Knapp
Force-Push: yes Change-Id: Icdb3f7f27c7ce0a615efbbef3317bb44cecb5caa
2026-04-09invent the concept of keywordsIrene Knapp
and define the ones related to Forth assembly Force-Push: yes Change-Id: Iae63e3e4875d6c66222f903f904bd46c00dfd40a
2026-04-08heap impls of the dot and pow stuffIrene Knapp
also, they're topologically sorted now, and the map is up to date these are Forth words, so their binary forms aren't checked Force-Push: yes Change-Id: I4738ae562d0ceb327396298a29598988453a0756
2026-04-08heap impl of stringcmp, also a couple more Forth asm wordsIrene Knapp
Force-Push: yes Change-Id: I10a098e9f6660ebec6a0beea6eda0a318c5e7f53
2026-04-08add heap implementations for more assembly string opsIrene Knapp
also add Forth words for a couple missing assembly instructions the map is kept carefully up-to-date through this, and the binary output of the new implementations was checked against the binary output of the original implementations using the new dictionary-debugging feature Force-Push: yes Change-Id: Icc8666dc0da9697ccab5d235b714efaa9bdba113
2026-04-08implement the new assembly-based words that needed heap implementationsIrene Knapp
Force-Push: yes Change-Id: I5afdff11ce6003deaeae5a9a0844596a593bd393
2026-04-08reorder things to better separate "early" stuffIrene Knapp
Change-Id: Ieba5e3fb7eca5be769cbf798eac0b91e31a1fe75 Force-Push: yes
2026-04-08update the "map" of stuff that needs to be copied to the heapIrene Knapp
a lot of small utilities got added or reorganized as part of writing the debug code. the map now reflects the current state both of what's been implemented in flatassembler, and what has a copy-to-heap implementation Force-Push: yes Change-Id: I749cd1814e4b9e5360b68a77461849b345b16559
2026-04-08change guess_entry_end_in's behavior for inputs that don't existIrene Knapp
this had been an outstanding TODO Force-Push: yes Change-Id: Ib3e4a654f3a4323175e2bbf37a6403a8b84ffc8d
2026-04-07remove debug notes accidentally left inIrene Knapp
Force-Push: yes Change-Id: I5516f0ba9a5fe954a1651dbf36df468a8d420f52
2026-04-07it now completely prints out its own source, backwardsIrene Knapp
if it were Mr. Mxyzptlk, it would now be vanquished Force-Push: yes Change-Id: I7af53bc2a2f5ab69850d9b8bee152c27d1878dc4
2026-04-05add width-padded variants of dotIrene Knapp
Force-Push: yes Change-Id: Idba4d4bc1f77a6dc34196673d7760461f9f99bb8
2026-04-05make dot work with arbitrary basesIrene Knapp
under the new names dothex and dotbase Change-Id: I783ad04c6eda1d607cef794788f7e09586650984 Force-Push: yes
2026-04-05make sure the logarithms work with really big numbersIrene Knapp
Force-Push: yes Change-Id: Ic084e13b4fe715bc08ac9ceb0e97f75d2fe7fedd
2026-04-05implement dot, the function that prints an integerIrene Knapp
Force-Push: yes Change-Id: I3e282f1d850dac1ee31fc8ee55ba6edecdacbfca
2026-04-05implement logfloor and logceilIrene Knapp
the comparators were all backwards; that's fixed now. it wasn't caught before because eq and ne are commutative, and of the others, only lt had ever been used, and only in one place Force-Push: yes Change-Id: I0a44f8abd21dfc8e0327441d8009e5150ea220da
2026-01-13exponentiation wordIrene Knapp
and a placeholder for integer printing Force-Push: yes Change-Id: Ie147f3010820ef740405bba9a932d1ae6067b49a
2025-12-22disassembly stuffIrene Knapp
this will pave the way for the copy thing currently it correctly prints out all the actual codeword pointers that are part of the word it's scrutinizing, but it has a placeholder for integers the hard part of this was figuring out the start and end addresses; the iteration was also kinda fiddly Change-Id: I2bb8d7c768ffc4d3d1d2afd83d1fd2227d15cbae Force-Push: yes
2025-11-29add words to find the next newer entry in the dictionaryIrene Knapp
these are fully debugged. they'll be used for the decompile-and-recompile copy logic Force-Push: yes Change-Id: I25ba5c5934fc3d181dadcfb4cce09727dbacf70f
2025-11-28add the code to traverse from execution token back to dictionary entryIrene Knapp
yay Force-Push: yes Change-Id: I21d21df017db6df3c1b60288f0b8c7270f01ded8
2025-11-28all the basic Forth words are implemented on the heap nowIrene Knapp
yay the assembly-defining words are still not Force-Push: yes Change-Id: I561a9304741f98d8f30209d3ba1c3bec9b84c950
2025-11-28reformat some word-on-heap definitions; change underscores to hyphensIrene Knapp
having chewed on it, we still prefer kebab-case Force-Push: yes Change-Id: I6ec87be808a4060599d052e8698d677dba7d0134
2025-11-28invoke the heap-based docol as part of the heap copyIrene Knapp
this adds an "execute" word, which makes execution tokens useful for something it also builds "emitstring" on the heap, at runtime, to test that that all works properly Force-Push: yes Change-Id: Ic59a489c0a035a4174db516aeef77e23c7d8528b
2025-11-28implement looking up words by name (wow!)Irene Knapp
also, fix strlen to not include the null byte Force-Push: yes Change-Id: Ifd95da1fc0cf7006df0a25278e03651d6185f037
2025-11-10implement stringcmp, with extensive commentingIrene Knapp
and a lot of other stuff necessary for that, as follows implement the "adc" and "sbb" instructions in flatassembler (there's no Forth implementation of them yet) implement "cmps8" in flatassembler; Forth already has a much more thorough suite of string instructions add Forth jmp_rel_imm8 and flatassembler jmp.rel.bimm unconditional jumps. they're nver used, it just seems like they should exist. split the disp8 case from the indirect case for the flatassembler implementation of register-to-register mov, to match how the Forth implementation works fix the name of mov.disp8.qreg.qreg, which had been incorrectly named mov.qreg.disp8.qreg. it's never called anyway. fix a citation for the MOV instruction; Intel's section numbers are confusing. Force-Push: yeah Change-Id: I53761a3487041c142ade1a82a8ab9a3f1129b853
2025-11-09implement the rest of the string instructionsIrene Knapp
in both repeatable and non-repeatable forms no ins or outs though Force-Push: yes Change-Id: Ica93a1de8b3b698db4e9b3c3c2f00b9e145a2064
2025-11-08implement sys_exit and sys_writeIrene Knapp
Force-Push: yes Change-Id: Idbdfe11a5ba4107c90065f015705708030684439
2025-11-08implement branch and 0branch; fix jmp_cc_rel_imm8Irene Knapp
Force-Push: yes Change-Id: I45c0a5e729cae2493e341ad3b6145708826383ab