4 ms·
@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 i
by zogomoox 5y ago
@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.
- db48x 5y agoI’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.
- nineties 5y agoThank 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.