larsbrinkhoff / lbForth

Self-hosting metacompiled Forth, bootstrapping from a few lines of C; targets Linux, Windows, ARM, RISC-V, 68000, PDP-11, asm.js.
GNU General Public License v3.0
418 stars 112 forks source link

Clean up asm.js target.fth #35

Closed larsbrinkhoff closed 7 years ago

larsbrinkhoff commented 7 years ago

The asm.js target.fth has two definitions for header,, which is probably a mistake.

Also, docol, etc compile a zero cell before the code field proper. I'm not sure that's by design or not. Is that the place for the "codeid", or the does field? I think the latter. But then the zero could probably move to header, like in the C target.

@pipcet, do you have any comment on this?

pipcet commented 7 years ago

Both mistakes. I missed that there was a double definition of header, and added the 0 , to get things working, but I should have just deleted the second definition of header,, I think.

larsbrinkhoff commented 7 years ago

Both mistakes.

Maybe not! Because asm.fth says

: header   parse-name header, 'dodoes , scount @ , reveal ;
larsbrinkhoff commented 7 years ago

Fixed by 9cda437.