the bottom n
bits. Thus the 6809's MUL instruction produces the correct
answer to A = -20 * B = -3 as it will store -60 in the B register.
-20*-3=-60 ?
(((-20) * (-3)) .EQ. (-60)) ?
if (-20 * -3 == -60) printf("always knew there was something
fundamentally wrong with the universe");
Ooops! If A=-20 and B=-3, then MUL stores 60 in the B register (the full
answer being 0xe93c) ;-)
If A=-20 and B=3, then MUL stores -60 in B (the full answer being 0x2c4)!
MUL does in fact perform 8-bit x 8-bit => 8-bit signed multiplication.
However I don't always type correctly!
-cheers from julz @P