2 Wanda on Nostr: so my favorite feature of the thing I'm currently reversing is that it has a numeric ...
so my favorite feature of the thing I'm currently reversing is that it has a numeric co-processor.
the base MCU is a custom 8-bit thing, not very far removed from the likes of 8051 or 6502. 256-byte memory space (actually 4kiB of RAM, since the second half of the space is bank-switched), 256 I/O ports, no registers at all (every normal operand is either absolute memory, or memory-indirect memory), and the only thing larger than 8 bits that this thing understands is code ROM addresses, which are 16-bit. no multiply opcode either, btw.
and then, since this is incredibly painful to do any math with, they just stapled a full 32-bit ALU to the side and attached it via the I/O port range.
behold this beautiful code snippet that multiplies a 32-bit number by 10 (it's part of the "convert from decimal" function):
the base MCU is a custom 8-bit thing, not very far removed from the likes of 8051 or 6502. 256-byte memory space (actually 4kiB of RAM, since the second half of the space is bank-switched), 256 I/O ports, no registers at all (every normal operand is either absolute memory, or memory-indirect memory), and the only thing larger than 8 bits that this thing understands is code ROM addresses, which are 16-bit. no multiply opcode either, btw.
and then, since this is incredibly painful to do any math with, they just stapled a full 32-bit ALU to the side and attached it via the I/O port range.
behold this beautiful code snippet that multiplies a 32-bit number by 10 (it's part of the "convert from decimal" function):
![](https://asdf.donotsta.re/media/15e8209a402a7c9d6bc59bfbd6f655c7a42c30095e48b51ac4ac5f7ade4f9fda.png)