bring cycle count down from 425 to 409
- mul_58: // 0101 1000 (24cy)
+ //don't care about top three bits (so don't compute them => _)
+ mul_58: // ___1 1000 (24cy)
LSR (a2)
ROR (a1)
LSR (a2)
LSR (a2)
ROR (a1)
LSR (a2)
ADC (a2, i1, carry)
LSR (a2)
ROR (a1)
ADC (a2, i1, carry)
LSR (a2)
ROR (a1)
- ADC (a2, i1, carry)
- LSR (a2)
- ROR (a1)
- mul_69: // 0110 1001 (26cy)
+ mul_69: // ___0 1001 (26cy)
ADD (a1, i0)
ADC (a2, i1, carry)
LSR (a2)
ADD (a1, i0)
ADC (a2, i1, carry)
LSR (a2)
LSR (a2)
ROR (a1)
ADD (a1, i0)
LSR (a2)
ROR (a1)
ADD (a1, i0)
- ADC (a2, i1, carry)
- LSR (a2)
- ROR (a1)
- ADC (a2, i1, carry)
- LSR (a2)
- ROR (a1)
- mul_75: // 0111 0101 (28cy)
+ mul_75: // ___1 0101 (28cy)
ADD (a1, i0)
ADC (a2, i1, carry)
LSR (a2)
ADD (a1, i0)
ADC (a2, i1, carry)
LSR (a2)
LSR (a2)
ROR (a1)
ADD (a1, i0)
LSR (a2)
ROR (a1)
ADD (a1, i0)
- ADC (a2, i1, carry)
- LSR (a2)
- ROR (a1)
- ADC (a2, i1, carry)
- LSR (a2)
- ROR (a1)
- mul_84: // 1000 0100 (22cy)
+ mul_84: // ___0 0100 (22cy)
LSR (a2)
ROR (a1)
LSR (a2)
LSR (a2)
ROR (a1)
LSR (a2)
- LSR (a2)
- ROR (a1)
- LSR (a2)
- ROR (a1)
- mul_8c: // 1000 1100 (24cy)
+ mul_8c: // ___0 1100 (24cy)
LSR (a2)
ROR (a1)
LSR (a2)
LSR (a2)
ROR (a1)
LSR (a2)
- LSR (a2)
- ROR (a1)
- LSR (a2)
- ROR (a1)
- mul_9d: // 1001 1101 (28cy)
+ mul_9d: // ___1 1101 (28cy)
ADD (a1, i0)
ADC (a2, i1, carry)
LSR (a2)
ADD (a1, i0)
ADC (a2, i1, carry)
LSR (a2)
ADC (a2, i1, carry)
LSR (a2)
ROR (a1)
ADC (a2, i1, carry)
LSR (a2)
ROR (a1)
- LSR (a2)
- ROR (a1)
- LSR (a2)
- ROR (a1)
- mul_b0: // 1011 0000 (22cy)
+ mul_b0: // ___1 0000 (22cy)
LSR (a2)
ROR (a1)
LSR (a2)
LSR (a2)
ROR (a1)
LSR (a2)
LSR (a2)
ROR (a1)
ADD (a1, i0)
LSR (a2)
ROR (a1)
ADD (a1, i0)
- ADC (a2, i1, carry)
- LSR (a2)
- ROR (a1)
- LSR (a2)
- ROR (a1)
- LSR (a2) //final shift is a common operation for all
- ROR (a1)
+ LSR (a1) //final shift is a common operation for all
// end MUL
MOV (t, a1)
#undef a0
#undef a1
#undef a2
// end MUL
MOV (t, a1)
#undef a0
#undef a1
#undef a2
- RET //TODO: replace CALL/RET with IJMP?
+ RET //TODO: replace CALL/RET with IJMP? (requires undoing goto-mul-hack)