News for hackers. Stuff that matters.
Re:Show HN: PlanckForth – Bootstrapping an interpreter from ... by zogomoox on Monday December 06, 2021 @05:19AM (#29458041)
@nineties, I'm curious why you included things like 'mul', 'divmod', 'and', 'or' in the initial instruction set? These can all be composed, so would make your initial ELF binary a bit smaller.
Re:Show HN: PlanckForth – Bootstrapping an interpreter from ... by db48x on Monday December 06, 2021 @05:36AM (#29458113)
I’d bet it was just because those are easy; there is a machine instruction to compute them. Might as well use it and have one less subroutine to define later.
Re:Show HN: PlanckForth – Bootstrapping an interpreter from ... by nineties on Monday December 06, 2021 @06:31AM (#29458438)
Thank you db48x. Yes, that's the reason. I added them to the first dictionary since these instructions are very simple even when writing in machine language.

In case of mod and divmod, implementing them with add, sub and loop has a serious performance issue. Replacing it with shift operations, bit operations, add, sub and loops could be an option.