How would you go about doing a modulus in asm anyway? XD I am makeing a sprite that I think will use the X coord as a peramiter like some of the normal ones do.
Your layout has been removed.
Your layout has been removed.
4204 wl++++ WRDIVL - Dividend C low byte 4205 wh++++ WRDIVH - Dividend C high byte dddddddd dddddddd 4206 wb++++ WRDIVB - Divisor B bbbbbbbb Write $4204/5, then $4206. 16 "machine cycles" (probably 96 master cycles) after $4206 is set, the quotient may be read from $4214/5, and the remainder from $4216/7. Presumably, $4204/5 are not altered by this process, much like $4202. The division is unsigned. Division by 0 gives a quotient of $FFFF and a remainder of C.
; A should be loaded with the input value ; X is the amount of reductions ; A is reduced by 100 until it is less than 100 LDX #$00 ; remove this if you don't want the amount of reductions .Loop1 CMP #$64 BCC .endLoop1 SBC #$64 INX ; remove this if you don't want the amount of reductions BRA .Loop1 .endLoop1