# HG changeset patch # User William Astle # Date 1701640639 25200 # Node ID b1958992a66a9e926e825e3576a7343cb0ec23d1 # Parent 1f2f6c2a1fde3abd657b2b8b64e842a969dc47c7 Properly initialize result for integer multiplication diff -r 1f2f6c2a1fde -r b1958992a66a src/int.s --- a/src/int.s Mon Oct 30 22:26:44 2023 -0600 +++ b/src/int.s Sun Dec 03 14:57:19 2023 -0700 @@ -204,8 +204,9 @@ ; ; The agorithm is simply this: zero out the result, then multiply fpa0 by each byte of fpa1 and then add the result ; to the result location. This yields a 64 bit product which is somewhat wasteful. -util_mul32 ldd zero ;* zero out result bits; low 16 bits don't need to be cleared and - stb fpaextra+3 ;* upper 24 bits also don't +util_mul32 ldd zero ;* zero out result bits; low 16 bits don't need to be cleared + std fpaextra + std fpaextra+2 std fpaextra+4 ldb fpa1+fpa.sig+3 ; multiply by low byte of fpa1 - no carries possible for this iteration lda fpa0+fpa.sig+3