Re:Qnice – An Elegant 16 Bit Processor
by titzer on Friday March 13, 2020 @04:26AM
(#22565652)
It's very useful to have the actual instruction mnemonics spelled out, instead of relying on an implicit (often overloaded) definition of "+". E.g. there might be a 8-bit, 16-bit, 32-bit integer add, a 32-bit, 64-bit floating point add, a 16x8 vector integer add, etc.
[ Parent
| on HN ]
Re:Qnice – An Elegant 16 Bit Processor
by throwaway_pdp09 on Friday March 13, 2020 @04:36AM
(#22565695)
Hm, good point. How about
a +=L b
for a long type? Or have a non-annotated opcode for the native machine word size (just '+') and annotated for anything smaller (edit: anything other) - ('+B' for byte addition).An alternative and perhaps much better higher-level solution is to have typed ASM. I believe there is work done in this area (quick search gets http://www.cs.cornell.edu/talc/), which would allow the type to be implicit but checkably safe but for the occasional explicitly needed coercions.