comparison src/fps.s @ 117:053fd2fb92e8

Check the correct extra precision byte for rounding during fp normalization
author William Astle <lost@l-w.ca>
date Wed, 27 Dec 2023 19:30:19 -0700
parents e72cda5e5ee2
children
comparison
equal deleted inserted replaced
116:e72cda5e5ee2 117:053fd2fb92e8
400 rol fpa0+fpa.sig 400 rol fpa0+fpa.sig
401 decb ; account for digit shift 401 decb ; account for digit shift
402 fps_normalize3 addb fpa0+fpa.exp ; adjust exponent 402 fps_normalize3 addb fpa0+fpa.exp ; adjust exponent
403 stb fpa0+fpa.exp 403 stb fpa0+fpa.exp
404 ble fps_normalize4 ; brif we underflowed to zero 404 ble fps_normalize4 ; brif we underflowed to zero
405 ldb fpaextra ; get extra precision digit 405 ldb fpa0+fpa.extra ; get extra precision digit
406 andb #0xf0 ; keep only the highest extra precision digit 406 andb #0xf0 ; keep only the highest extra precision digit
407 cmpb #0x50 ; do we need to round? 407 cmpb #0x50 ; do we need to round?
408 blo fps_normalize5 ; brif not 408 blo fps_normalize5 ; brif not
409 lda fpa0+fpa.sig+4 ; bump low digits 409 lda fpa0+fpa.sig+4 ; bump low digits
410 adda #1 410 adda #1