reversed botched attempt to increase FP division precission
This commit is contained in:
1 parent
2c76825286
commit
e16118a331
3 files changed
+14
-24
No files matched your search
@@ -3,17 +3,21 @@
|
||||
// #LAYOUT# * * #IGNORE
|
||||
|
||||
//
|
||||
// Math package - denormalize FAC1 mantissa and adapt its exponent accordingly,
|
||||
// so that division is more precise
|
||||
// Math package - denormalize FAC1 mantissa and adapt its exponent accordingly
|
||||
//
|
||||
|
||||
// XXX test this
|
||||
|
||||
div_FAC1_denorm:
|
||||
|
||||
// Set FACOV to 0, no need for increased precision here
|
||||
|
||||
lda #$00
|
||||
sta FACOV
|
||||
|
||||
// Start by moving whole bytes, if possible
|
||||
|
||||
lda FACOV
|
||||
lda FAC1_mantissa+3
|
||||
bne div_FAC1_denorm_by_bit // branch if last byte of mantissa is non-zero
|
||||
|
||||
lda FAC1_exponent
|
||||
@@ -27,8 +31,6 @@ div_FAC1_denorm:
|
||||
|
||||
// Move mantissa bytes
|
||||
|
||||
lda FAC1_mantissa+3
|
||||
sta FACOV
|
||||
lda FAC1_mantissa+2
|
||||
sta FAC1_mantissa+3
|
||||
lda FAC1_mantissa+1
|
||||
@@ -42,7 +44,7 @@ div_FAC1_denorm:
|
||||
|
||||
div_FAC1_denorm_by_bit:
|
||||
|
||||
lda FACOV
|
||||
lda FAC1_mantissa+3
|
||||
and #$01
|
||||
bne div_FAC1_denorm_done // branch if lowest bit of mantissa is already 1
|
||||
|
||||
@@ -61,7 +63,6 @@ div_FAC1_denorm_by_bit:
|
||||
ror FAC1_mantissa+1
|
||||
ror FAC1_mantissa+2
|
||||
ror FAC1_mantissa+3
|
||||
ror FACOV
|
||||
|
||||
bcc div_FAC1_denorm_by_bit // branch always
|
||||
|
||||
|
||||
Reference in new issue
Block a user