Skip to content

Commit 2317e6a

Browse files
comments
1 parent 40dc62b commit 2317e6a

File tree

3 files changed

+9
-6
lines changed

3 files changed

+9
-6
lines changed

math.asm

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -335,6 +335,7 @@ normalize: ; normalize bahl to return inexact result bcde with sign' l' bit 7
335335
; FLOATING POINT CONSTANT ZERO
336336
;
337337
; fzero: 0.0 -> bcde
338+
; cf reset
338339
; a,b,c,d,e modified
339340
;
340341
;-------------------------------------------------------------------------------
@@ -410,6 +411,8 @@ fmul: EXPA ; exponent -> a
410411
ex af,af' ; restore a and cf
411412
jp shiftoncarry ; normalize bahl to return float bcde
412413

414+
; out of range, return zero (underflow, cf reset) or overflow (cf set)
415+
413416
outofrange: add a ; carry if bit 7 set
414417
jr nc,fzero ; if incorrect positive then return zero (underflow, cf reset)
415418
ret ; return with overflow error (cf set)
@@ -608,7 +611,7 @@ itof: ld a,b ;
608611

609612
; set result exponent b and normalize nonzero mantissa ahl.e
610613

611-
ld b,bias + 31 ; set exponent b
614+
ld b,bias+31 ; set exponent b
612615
or a ;
613616
jp m,finalize ; if a bit 7 not set then
614617
1$: dec b ; 4 ; loop, decrement exponent b (cannot underflow)

mathr.asm

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -85,10 +85,10 @@
8585
; -1 = bf 80 00 00
8686
; -2 = c0 00 00 00
8787
; -3 = c0 40 00 00
88-
; inf = 7f 80 00 00 n/a (invalid value)
89-
; -inf = ff 80 00 00 n/a (invalid value)
88+
; inf = 7f 80 00 00 n/a (invalid value in this version)
89+
; -inf = ff 80 00 00 n/a (invalid value in this version)
9090
; nan = s 11111111 xxxxxxx xxxxxxxx xxxxxxxx at least one x is 1
91-
; n/a (invalid value)
91+
; n/a (invalid value in this version)
9292
;
9393
; IEEE 754 binary floating point allows floating point values to
9494
; be compared as if comparing 32 bit signed integers with 'i<':
@@ -659,7 +659,7 @@ fdivy: EXPA ; exponent -> a
659659
exx ; activate bcdehl
660660
set 7,c ; set bit 7 of man2 c
661661

662-
; divide mantissas cde' / cde -> chl'
662+
; divide mantissas cde' / cde -> quotient chl' remainder ahl
663663

664664
xor a ;
665665
ld h,a ;

mathri.asm

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -830,7 +830,7 @@ fdivy: EXPA ; exponent -> a
830830
exx ; activate bcdehl
831831
set 7,c ; set bit 7 of man2 c
832832

833-
; divide mantissas cde' / cde -> chl'
833+
; divide mantissas cde' / cde -> quotient chl' remainder ahl
834834

835835
xor a ;
836836
ld h,a ;

0 commit comments

Comments
 (0)