Page 1 of 1

How to multiply on snes

Posted: Wed May 11, 2022 5:58 pm
by jeffythedragonslayer
Alright so I've been reading this page (https://www.chibiakumas.com/6502/snes.php) and it looks like to do a genuine multiplication (not repeated addition) the multiplicands need to be put in the WRMPYA and WRMPYB ports, then the product read out of MPYL, MPYM, and MPYH. Isn't there an instruction I need to use to do the multiply, or does the result magically appear in those 3 MPY registers?

Re: How to multiply on snes

Posted: Sat May 21, 2022 8:26 pm
by jeffythedragonslayer
After discussion with Nova, I was able to crack this one:

Code: Select all

; multiply
   lda #$7     ; 1st multiplicand
   sta WRMPYA
   lda #$5     ; 2nd multiplicand
   sta WRMPYB 
   nop         ; wait 8 cycles
   nop
   nop
   nop
   lda $RDMPYL ; low byte of product
   lda $RDMPYH ; high byte of product