diff --git a/src/basic/math/b947.inv_FAC1.s b/src/basic/math/b947.inv_FAC1.s index c97d3b7b..e9f2443e 100644 --- a/src/basic/math/b947.inv_FAC1.s +++ b/src/basic/math/b947.inv_FAC1.s @@ -39,6 +39,7 @@ inv_FAC1_mantissa: lda FACOV eor #$FF sta FACOV + inc FACOV bne inc_FAC1_ret ; Fallthrough to inc_FAC1 diff --git a/src/basic/math/b983.shiftr_FAC.s b/src/basic/math/b983.shiftr_FAC.s index 6cf67738..ea124828 100644 --- a/src/basic/math/b983.shiftr_FAC.s +++ b/src/basic/math/b983.shiftr_FAC.s @@ -45,7 +45,7 @@ shiftr_FAC: sbc #8 ; Go back to previous value tay lda FACOV - bcs shiftr_FAC + bcs shftrt .sext: asl 1,X bcc @2 diff --git a/src/basic/math/bc1b.round_FAC1.jmp.s b/src/basic/math/bc1b.round_FAC1.jmp.s index 47f8b624..81b1ef11 100644 --- a/src/basic/math/bc1b.round_FAC1.jmp.s +++ b/src/basic/math/bc1b.round_FAC1.jmp.s @@ -5,5 +5,6 @@ ; Just a compatibility jump - our routine is longer than original one - jmp round_FAC1 +round_FAC1: + jmp round_FAC1_impl diff --git a/src/basic/math/round_FAC1.s b/src/basic/math/round_FAC1.s index 0b401ef9..e8437d57 100644 --- a/src/basic/math/round_FAC1.s +++ b/src/basic/math/round_FAC1.s @@ -12,7 +12,7 @@ ; XXX test this -round_FAC1: +round_FAC1_impl: ; If number is 0, do not do anything diff --git a/src/basic/math_mov/bbd0.mov_r_FAC1_VAR.s b/src/basic/math_mov/bbd0.mov_r_FAC1_VAR.s index 6330dd3b..5c5e5094 100644 --- a/src/basic/math_mov/bbd0.mov_r_FAC1_VAR.s +++ b/src/basic/math_mov/bbd0.mov_r_FAC1_VAR.s @@ -20,7 +20,7 @@ mov_r_FAC1_VAR: - ldx #FORPNT+0 - ldy #FORPNT+1 + ldx FORPNT+0 + ldy FORPNT+1 ; FALLTROUGH to mov_r_FAC1_MEM diff --git a/src/basic/math_mov/bbfc.mov_FAC2_FAC1.s b/src/basic/math_mov/bbfc.mov_FAC2_FAC1.s index 7da15a4f..148ccb00 100644 --- a/src/basic/math_mov/bbfc.mov_FAC2_FAC1.s +++ b/src/basic/math_mov/bbfc.mov_FAC2_FAC1.s @@ -32,7 +32,7 @@ mov_FAC2_FAC1: lda FAC2_sign mov_FAC2_FAC1_sign: - sta FAC2_sign + sta FAC1_sign ; Copy the mantissa and the exponent diff --git a/tools/similarity.c b/tools/similarity.c index 54ffe503..862b68df 100644 --- a/tools/similarity.c +++ b/tools/similarity.c @@ -92,7 +92,11 @@ int main(int argc,char **argv) if (basic) { for (int i = 0; i < NUM_CHUNKS; i++) { for (int addr = microsoft_basic_chunks[i * 2]; addr <= microsoft_basic_chunks[i * 2 + 1]; addr++) { - f1[addr - 0xA000] = 0; + short index = addr - 0xA000; + if (f1[index] != f2[index]) { + printf("BASIC does not match MS BASIC at %X (%X != %X)\n", addr, f1[index], f2[index]); + } + f1[index] = 0; } } }