Couldn't you just take the absolute value of both factors and then figure out whether the product should be positive or negative and adjust it accordingly?
like check each factor -- if one negative, set a flag and convert the number to its positive counterpart (EOR #$FF CLC ADC #$01) -- do normal, unsigned multiplication with the two factors... and if the product is supposed to be negative (one factor -- but not both negative), negate it.
edit: code to help suggest the idea in case my explaination isn't clear. This isn't the quickest way to do it, but it should give the general idea
Code: Select all
CLC
LDA #$00
STA sign_flag
LDA factor_1
BPL :+
EOR #$FF
ADC #$01
STA factor_1
LDA sign_flag
EOR #$01
STA sign_flag
:
LDA factor_2
BPL :+
EOR #$FF
ADC #$01
STA factor_2
LDA sign_flag
EOR #$01
STA sign_flag
:
JSR unsigned_mult_routine
LDA sign_flag
BEQ :+
CLC
LDA product_lo
EOR #$FF
ADC #$01
STA product_lo
LDA product_hi
EOR #$FF
ADC #$00
STA product_hi
:
RTS