From 586ee998c69ed2276ad9ed71404312a6dd6dd07a Mon Sep 17 00:00:00 2001 From: FeralChild64 Date: Sun, 16 Feb 2020 16:18:19 +0100 Subject: [PATCH] adding of floating point values works now --- STATUS.md | 10 +++++----- c64/basic/math/b86a.add_FAC2_FAC1.s | 15 +++++++++++---- 2 files changed, 16 insertions(+), 9 deletions(-) diff --git a/STATUS.md b/STATUS.md index 49b5c4c7..7c20cb47 100644 --- a/STATUS.md +++ b/STATUS.md @@ -191,22 +191,22 @@ Floating point mathematical routines - not official, but well known and broadly | `$B849` | `add_HALF_FAC1` | NOT DONE | | | `$B850` | `sub_MEM_FAC1` | PARTIAL | needs `add_FAC2_FAC1` | | `$B853` | `sub_FAC2_FAC1` | PARTIAL | needs `add_FAC2_FAC1` | -| `$B862` | `add_align_exponents` | PARTIAL | not tested yet | +| `$B862` | `add_align_exponents` | DONE | | | `$B867` | `add_MEM_FAC1` | PARTIAL | needs `add_FAC2_FAC1` | -| `$B86A` | `add_FAC2_FAC1` | PARTIAL | not tested yet | -| `$B8FE` | `normal_FAC1` | PARTIAL | not tested yet | +| `$B86A` | `add_FAC2_FAC1` | PARTIAL | aubstration not tested yet | +| `$B8FE` | `normal_FAC1` | PARTIAL | not fully tested yet | | `$B947` | `inv_FAC1_mantissa` | NOT DONE | | | `$B983` | `MULSHF` | NOT DONE | | | `$B9EA` | `log_FAC1` | NOT DONE | | | `$BA28` | `mul_MEM_FAC1` | PARTIAL | needs `mul_FAC2_FAC1` | | `$BA2B` | `mul_FAC2_FAC1` | NOT DONE | | | `$BA59` | `MLTPLY` | NOT DONE | | -| `$BA8C` | `mov_MEM_FAC2` | PARTIAL | not fully tested yet | +| `$BA8C` | `mov_MEM_FAC2` | DONE | | | `$BAE2` | `mul10_FAC1` | NOT DONE | | | `$BAFE` | `div10_FAC1_p` | NOT DONE | | | `$BB0F` | `div_MEM_FAC1` | PARTIAL | needs `div_FAC2_FAC1` | | `$BB12` | `div_FAC2_FAC1` | NOT DONE | | -| `$BBA2` | `mov_MEM_FAC1` | PARTIAL | not fully tested yet | +| `$BBA2` | `mov_MEM_FAC1` | DONE | | | `$BBC7` | `mov_r_FAC1_TMP2` | PARTIAL | not fully tested yet | | `$BBCA` | `mov_r_FAC1_TMP1` | PARTIAL | not fully tested yet | | `$BBD0` | `mov_r_FAC1_VAR` | PARTIAL | not fully tested yet | diff --git a/c64/basic/math/b86a.add_FAC2_FAC1.s b/c64/basic/math/b86a.add_FAC2_FAC1.s index 7ed3aa98..1e6bf6b9 100644 --- a/c64/basic/math/b86a.add_FAC2_FAC1.s +++ b/c64/basic/math/b86a.add_FAC2_FAC1.s @@ -62,10 +62,10 @@ add_FAC2_FAC1: adc FAC1_mantissa+0 sta FAC1_mantissa+0 - bcc add_FAC2_FAC1_normalize // end if no need to adapt the exponent + bcc_16 normal_FAC1 // end if no need to adapt the exponent inc FAC1_exponent - bne add_FAC2_FAC1_normalize // end if no overflow + bne add_FAC2_FAC1_adapt_mantissa // end if no overflow lda #$FF sta FAC1_exponent @@ -80,6 +80,13 @@ add_FAC2_FAC1_done: rts -add_FAC2_FAC1_normalize: +add_FAC2_FAC1_adapt_mantissa: + + sec + ror FAC1_mantissa+0 + ror FAC1_mantissa+1 + ror FAC1_mantissa+2 + ror FAC1_mantissa+3 + ror FACOV - jmp normal_FAC1 + rts