leah & nybbles & bytes, oh my! on Nostr: wait, locals? well, one of the classic reasons for dropping into assembly language in ...
wait, locals? well, one of the classic reasons for dropping into assembly language in Forth is if you have a word that ends up being really clumsy to express in stack terms, but which is a lot simpler to express if you can stow the parameters and intermediate results in registers. the cliché that keeps being brought up for that is vector multiplication, which needs 6 parameters from the stack and accesses them more or less at random. yes, it gets easier if you have variables, but it's also exactly the thing you'd drop into assembly language to implement, because it *is* such a low level thing - if you need it enough to code it at all, chances are you'll need it to be fast too
indeed, if something you know is indivisible ends up being a slog to write in Forth, that's generally a sign that you need to drop down to assembly language for that one.
indeed, if something you know is indivisible ends up being a slog to write in Forth, that's generally a sign that you need to drop down to assembly language for that one.