File tree Expand file tree Collapse file tree 3 files changed +9
-6
lines changed Expand file tree Collapse file tree 3 files changed +9
-6
lines changed Original file line number Diff line number Diff line change @@ -335,6 +335,7 @@ normalize: ; normalize bahl to return inexact result bcde with sign' l' bit 7
335
335
; FLOATING POINT CONSTANT ZERO
336
336
;
337
337
; fzero: 0.0 -> bcde
338
+ ; cf reset
338
339
; a,b,c,d,e modified
339
340
;
340
341
;-------------------------------------------------------------------------------
@@ -410,6 +411,8 @@ fmul: EXPA ; exponent -> a
410
411
ex af , af' ; restore a and cf
411
412
jp shiftoncarry ; normalize bahl to return float bcde
412
413
414
+ ; out of range, return zero (underflow, cf reset) or overflow (cf set)
415
+
413
416
outofrange: add a ; carry if bit 7 set
414
417
jr nc , fzero ; if incorrect positive then return zero (underflow, cf reset)
415
418
ret ; return with overflow error (cf set)
@@ -608,7 +611,7 @@ itof: ld a,b ;
608
611
609
612
; set result exponent b and normalize nonzero mantissa ahl.e
610
613
611
- ld b , bias + 31 ; set exponent b
614
+ ld b , bias + 31 ; set exponent b
612
615
or a ;
613
616
jp m , finalize ; if a bit 7 not set then
614
617
1 $: dec b ; 4 ; loop, decrement exponent b (cannot underflow)
Original file line number Diff line number Diff line change 85
85
; -1 = bf 80 00 00
86
86
; -2 = c0 00 00 00
87
87
; -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 )
90
90
; 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 )
92
92
;
93
93
; IEEE 754 binary floating point allows floating point values to
94
94
; be compared as if comparing 32 bit signed integers with 'i<':
@@ -659,7 +659,7 @@ fdivy: EXPA ; exponent -> a
659
659
exx ; activate bcdehl
660
660
set 7 , c ; set bit 7 of man2 c
661
661
662
- ; divide mantissas cde' / cde -> chl'
662
+ ; divide mantissas cde' / cde -> quotient chl' remainder ahl
663
663
664
664
xor a ;
665
665
ld h , a ;
Original file line number Diff line number Diff line change @@ -830,7 +830,7 @@ fdivy: EXPA ; exponent -> a
830
830
exx ; activate bcdehl
831
831
set 7 , c ; set bit 7 of man2 c
832
832
833
- ; divide mantissas cde' / cde -> chl'
833
+ ; divide mantissas cde' / cde -> quotient chl' remainder ahl
834
834
835
835
xor a ;
836
836
ld h , a ;
You can’t perform that action at this time.
0 commit comments