3 ms·
uh! Adding a number to itself for multiplication by 2 instead of one quick shift to the left?
by dorfsmay 10y ago
uh! Adding a number to itself for multiplication by 2 instead of one quick shift to the left?
- sehugg 10y agoThe Z80 has no 16-bit shift instruction, but has 16-bit add/subtract :)
- vardump 10y agoOther than the obvious 8 vs 16 bit issue: I don't know any platform where bit shift left is faster than addition. Usually it's just as fast. But on some platforms, you need to first clear carry bit, because they only have rotate and rotate through carry instructions available.