Jump to content



1

TI Floating point range


14 replies to this topic

#1 Willsy ONLINE  

Willsy

    Dragonstomper

  • 765 posts
  • Location:Uzbekistan (no, really!)

Posted Mon Aug 29, 2011 3:19 PM

Does anybody know how many digits there are in front of and behind the decimal point in a TI FP number?

Or, is it dynamic (i.e. "floating point" ;))

Thanks

#2 sometimes99er ONLINE  

sometimes99er

    Stargunner

  • 1,922 posts
  • Location:Denmark

Posted Mon Aug 29, 2011 3:24 PM

View PostWillsy, on Mon Aug 29, 2011 3:19 PM, said:

Does anybody know how many digits there are in front of and behind the decimal point in a TI FP number?

Or, is it dynamic (i.e. "floating point" ;))

Thanks
Dynamic. Radix 100.
Overall size: 64 bits
Power: 8 bits
14 significant digits (total, front and back)

:)

Edited by sometimes99er, Mon Aug 29, 2011 3:36 PM.


#3 adamantyr OFFLINE  

adamantyr

    Moonsweeper

  • 424 posts

Posted Mon Aug 29, 2011 3:32 PM

View Postsometimes99er, on Mon Aug 29, 2011 3:24 PM, said:

View PostWillsy, on Mon Aug 29, 2011 3:19 PM, said:

Does anybody know how many digits there are in front of and behind the decimal point in a TI FP number?

Or, is it dynamic (i.e. "floating point" ;))

Thanks
Dynamic. Radix 100.
Overall size: 64 bits
Power: 8 bits
14 significant digits

:)

What he said. Radix 100 is pretty decent, and easier to implement than the IEEE 754 system most modern processors use.

Adamantyr

#4 Willsy ONLINE  

Willsy

    Dragonstomper

  • 765 posts
  • Location:Uzbekistan (no, really!)

Posted Mon Aug 29, 2011 3:55 PM

View Postadamantyr, on Mon Aug 29, 2011 3:32 PM, said:

View Postsometimes99er, on Mon Aug 29, 2011 3:24 PM, said:

View PostWillsy, on Mon Aug 29, 2011 3:19 PM, said:

Does anybody know how many digits there are in front of and behind the decimal point in a TI FP number?

Or, is it dynamic (i.e. "floating point" ;))

Thanks
Dynamic. Radix 100.
Overall size: 64 bits
Power: 8 bits
14 significant digits

:)

What he said. Radix 100 is pretty decent, and easier to implement than the IEEE 754 system most modern processors use.

Adamantyr

Agreed. I quite like it - although the way -tive values are represented are a pain in the ass (only the first two bytes inverted, the rest not)

Mark

#5 adamantyr OFFLINE  

adamantyr

    Moonsweeper

  • 424 posts

Posted Mon Aug 29, 2011 4:09 PM

View PostWillsy, on Mon Aug 29, 2011 3:55 PM, said:

Agreed. I quite like it - although the way -tive values are represented are a pain in the ass (only the first two bytes inverted, the rest not)

Mark

It's also a royal PAIN to use the built-in FP routines in assembly language. They're hard-coded to use the scratchpad in various places and the various functions are scattered between GPLLNK and XMLLNK respectively.

GPLLNK is particularly annoying to use. I know people have written custom GPLLNK routines, would be good to see one that isn't as difficult to manage as the original.

Adamantyr

#6 RXB OFFLINE  

RXB

    Dragonstomper

  • 539 posts
  • Location:Vancouver, Washington, USA

Posted Mon Aug 29, 2011 4:23 PM

The very best GPLLNK ever written is the one in the Smart Programmer from Miller Graphics. This one works for any type of problem you have.

The main problem people have is the cut down GPLLNK versions do not work all that well, but people keep using them. Same for the DSRLNK as the cut down one just crashes alot.

SP8607 (Smart Programmer Magazine) has the GPLLNK / DSRLNK and was included in the RXB 1005 package as it was so good.

I have stated in the RXB manual many times that the problem is the use of the cut down GPLLNK and DSRLNK as 90% of problems people have .

#7 Willsy ONLINE  

Willsy

    Dragonstomper

  • 765 posts
  • Location:Uzbekistan (no, really!)

Posted Mon Aug 29, 2011 4:27 PM

Here's mine - buried inside the TF ROM ;)

;[ GPLLNK     
; This routine is based on the routine published in the July 1986 edition of 
; Smart Programmer. Modified by yours truly to allow it be executed from ROM.
gplws	equ >83e0		; GPL workspace
gr4	equ gplws+8		; GPL R4
gr6	equ gplws+12		; GPL R6
stkpnt	equ >8373		; GPL stack pointer
ldgadd	equ >60			; load and execute grom address entry point
xtab27	equ	>200e		; low mem XML table location 27
getstk	equ >166c

; cpu register data - this data is copied into >200e onwards, so that it sits
; in R7 onwards
gpllnk	data glnkws		; [mapped to R7] set up BLWP vectors
	data glink1		; [mapped to R8] 
rtnad	data xmlrtn		; [mapped to R9]
gxmlad	data >176c		; [mapped to R10] GROM address for GPL XML 0F27 opcode
	data >50		; [mapped to R11] Initialised to >50 where PUTSTK 
				; address resides

; this routine runs in it's own workspace, starting at >2000
glnkws	equ >2000		; GPLLNKs workspace of which only registers R7 thru R15
				; are used

glink1	li r0,gpllnk		; we need to copy the cpu register data (above) to
	li r1,>200e		; RAM. R0=Source, R1=Destination
	li r2,5			; R2=Word count
gpllop	mov *r0+,*r1+		; copy the data above into r7 onwards...
	dec r2			; copied all of it?
	jne gpllop		; loop if not
	
	mov *r11,@gr4		; put PUTSTK address into R4 of GPL WS
	mov *r14+,@gr6		; put GPL routine address in r6 of GPL WS
	mov r9,@xtab27		; put XMLRTN address into >200e
	lwpi gplws		; load GPL workspace
	bl *r4			; save current GROM address on stack
	mov @gxmlad,@>8302(r4)	; push GPL XML address on stack for GPL return
	inct @stkpnt		; adjsut the stack pointer
	b @ldgadd		; execute our GPL routine
xmlrtn	mov @getstk,r4		; get GETSTK pointer
	bl *r4			; restore GROM address off the stack
	lwpi glnkws		; load our ws
	rtwp			; all done - return to caller
;]


#8 RXB OFFLINE  

RXB

    Dragonstomper

  • 539 posts
  • Location:Vancouver, Washington, USA

Posted Mon Aug 29, 2011 4:34 PM

View PostWillsy, on Mon Aug 29, 2011 4:27 PM, said:

Here's mine - buried inside the TF ROM ;)

;[ GPLLNK     
; This routine is based on the routine published in the July 1986 edition of 
; Smart Programmer. Modified by yours truly to allow it be executed from ROM.
gplws    equ >83e0        ; GPL workspace
gr4    equ gplws+8        ; GPL R4
gr6    equ gplws+12        ; GPL R6
stkpnt    equ >8373        ; GPL stack pointer
ldgadd    equ >60            ; load and execute grom address entry point
xtab27    equ    >200e        ; low mem XML table location 27
getstk    equ >166c

; cpu register data - this data is copied into >200e onwards, so that it sits
; in R7 onwards
gpllnk    data glnkws        ; [mapped to R7] set up BLWP vectors
    data glink1        ; [mapped to R8] 
rtnad    data xmlrtn        ; [mapped to R9]
gxmlad    data >176c        ; [mapped to R10] GROM address for GPL XML 0F27 opcode
    data >50        ; [mapped to R11] Initialised to >50 where PUTSTK 
                ; address resides

; this routine runs in it's own workspace, starting at >2000
glnkws    equ >2000        ; GPLLNKs workspace of which only registers R7 thru R15
                ; are used

glink1    li r0,gpllnk        ; we need to copy the cpu register data (above) to
    li r1,>200e        ; RAM. R0=Source, R1=Destination
    li r2,5            ; R2=Word count
gpllop    mov *r0+,*r1+        ; copy the data above into r7 onwards...
    dec r2            ; copied all of it?
    jne gpllop        ; loop if not
    
    mov *r11,@gr4        ; put PUTSTK address into R4 of GPL WS
    mov *r14+,@gr6        ; put GPL routine address in r6 of GPL WS
    mov r9,@xtab27        ; put XMLRTN address into >200e
    lwpi gplws        ; load GPL workspace
    bl *r4            ; save current GROM address on stack
    mov @gxmlad,@>8302(r4)    ; push GPL XML address on stack for GPL return
    inct @stkpnt        ; adjsut the stack pointer
    b @ldgadd        ; execute our GPL routine
xmlrtn    mov @getstk,r4        ; get GETSTK pointer
    bl *r4            ; restore GROM address off the stack
    lwpi glnkws        ; load our ws
    rtwp            ; all done - return to caller
;]

LOL this is a exact copy of the Miller Graphic GPLLNK, well done!!!!

#9 Vorticon OFFLINE  

Vorticon

    Moonsweeper

  • 494 posts
  • Location:St. Paul, MN, USA

Posted Mon Aug 29, 2011 5:11 PM

View Postadamantyr, on Mon Aug 29, 2011 4:09 PM, said:

View PostWillsy, on Mon Aug 29, 2011 3:55 PM, said:

Agreed. I quite like it - although the way -tive values are represented are a pain in the ass (only the first two bytes inverted, the rest not)

Mark

It's also a royal PAIN to use the built-in FP routines in assembly language. They're hard-coded to use the scratchpad in various places and the various functions are scattered between GPLLNK and XMLLNK respectively.

GPLLNK is particularly annoying to use. I know people have written custom GPLLNK routines, would be good to see one that isn't as difficult to manage as the original.

Adamantyr
There is also a bug in the FCOMP function which consistently gives you incorrect results. I kind of got used to these routines after a while, and they are really not that bad once you get past the initial shock :D

#10 Vorticon OFFLINE  

Vorticon

    Moonsweeper

  • 494 posts
  • Location:St. Paul, MN, USA

Posted Mon Aug 29, 2011 5:15 PM

View Postsometimes99er, on Mon Aug 29, 2011 3:24 PM, said:

View PostWillsy, on Mon Aug 29, 2011 3:19 PM, said:

Does anybody know how many digits there are in front of and behind the decimal point in a TI FP number?

Or, is it dynamic (i.e. "floating point" ;))

Thanks
Dynamic. Radix 100.
Overall size: 64 bits
Power: 8 bits
14 significant digits (total, front and back)

:)

Bruce Harrison wrote a great article on Radix 100 in his Art of Assembly series. It's available for download on the WHT ftp site (ftp.wht.com).

#11 RXB OFFLINE  

RXB

    Dragonstomper

  • 539 posts
  • Location:Vancouver, Washington, USA

Posted Mon Aug 29, 2011 5:48 PM

View PostVorticon, on Mon Aug 29, 2011 5:11 PM, said:

View Postadamantyr, on Mon Aug 29, 2011 4:09 PM, said:

View PostWillsy, on Mon Aug 29, 2011 3:55 PM, said:

Agreed. I quite like it - although the way -tive values are represented are a pain in the ass (only the first two bytes inverted, the rest not)

Mark

It's also a royal PAIN to use the built-in FP routines in assembly language. They're hard-coded to use the scratchpad in various places and the various functions are scattered between GPLLNK and XMLLNK respectively.

GPLLNK is particularly annoying to use. I know people have written custom GPLLNK routines, would be good to see one that isn't as difficult to manage as the original.

Adamantyr
There is also a bug in the FCOMP function which consistently gives you incorrect results. I kind of got used to these routines after a while, and they are really not that bad once you get past the initial shock :D

The problem is >03DA in the Assembly version has issues. On the other hand XB source for Min and Max:

<0329> ***********************************************************
<0330> A258 06,A2,6D NMAX CALL MAXMIN Combine MAX and MIN
<0331> A25B 0A GT
<0332> A25C 42,63 BR GA263
<0333> A25E 35,00,08 NMAXZ1 MOVE 8,@ARG,@FAC
A261 4A,5C
<0334> A263 0F,75 GA263 XML CONT
<0335> ***********************************************************
<0336> * NUD FOR MIN
<0337> ***********************************************************
<0338> A265 06,A2,6D NMIN CALL MAXMIN Combine MAX and MIN again
<0339> A268 0A GT
<0340> A269 42,5E BR NMAXZ1
<0341> A26B 0F,75 XML CONT
<0342> ***********************************************************
<0343> * COMMON MAX / MIN ROUTINE
<0344> ***********************************************************
<0345> A26D 06,AB,F3 MAXMIN CALL LPAR Skip "(" parse, and insure ,
<0346> A270 C6,4C,63 CH >63,@FAC2 Must be numeric
<0347> A273 6D,28 BS ERRSNM
<0348> A275 0F,77 XML VPUSH Push l.h. arg on stack
<0349> A277 0F,74 XML PARSE PARSE up to ")"
<0350> A279 B6 BYTE RPARZ
<0351> A27A C6,4C,63 CH >63,@FAC2 Must be numeric
<0352> A27D 6D,28 BS ERRSNM
<0353> A27F 0F,7E XML SPEED Must be
<0354> A281 00 BYTE SYNCHK * at a
<0355> A282 B6 BYTE RPARZ * right parenthesis
<0356> A283 35,00,08 MOVE 8,@FAC,@ARG Save in ARG for compare
A286 5C,4A
<0357> A288 0F,78 XML VPOP Get l.h. arg back
<0358> A28A 0F,0A XML FCOMP Compare operands
<0359> A28C 00 RTN

Notice that only GT (Greater Then) is used for the FCOMP in XB GPL Source and that it works fine for Min or Max in XB. The access from Assembly appears to have a problem.

#12 OLD CS1 OFFLINE  

OLD CS1

    Moonsweeper

  • 392 posts
  • IT Samurai
  • Location:Tallahassee, FL

Posted Mon Aug 29, 2011 8:59 PM

What about the issue where SQR(9) does not equal 3? Is that a bug or an issue with precision?

#13 Willsy ONLINE  

Willsy

    Dragonstomper

  • 765 posts
  • Location:Uzbekistan (no, really!)

Posted Tue Aug 30, 2011 12:40 AM

View PostRXB, on Mon Aug 29, 2011 4:34 PM, said:

LOL this is a exact copy of the Miller Graphic GPLLNK, well done!!!!

Sigh...

View PostWillsy, on Mon Aug 29, 2011 4:27 PM, said:

; This routine is based on the routine published in the July 1986 edition of 
; Smart Programmer. Modified by yours truly to allow it be executed from ROM.


#14 sometimes99er ONLINE  

sometimes99er

    Stargunner

  • 1,922 posts
  • Location:Denmark

Posted Tue Aug 30, 2011 1:38 AM

View PostWillsy, on Tue Aug 30, 2011 12:40 AM, said:

View PostRXB, on Mon Aug 29, 2011 4:34 PM, said:

LOL this is a exact copy of the Miller Graphic GPLLNK, well done!!!!

Sigh...

View PostWillsy, on Mon Aug 29, 2011 4:27 PM, said:

; This routine is based on the routine published in the July 1986 edition of 
; Smart Programmer. Modified by yours truly to allow it be executed from ROM.

However, RXB is not an exact copy of XB. - For instance it has an R. Come on, say it, Rrrrrrrr ...

#15 RXB OFFLINE  

RXB

    Dragonstomper

  • 539 posts
  • Location:Vancouver, Washington, USA

Posted Tue Aug 30, 2011 4:45 AM

View Postsometimes99er, on Tue Aug 30, 2011 1:38 AM, said:

View PostWillsy, on Tue Aug 30, 2011 12:40 AM, said:

View PostRXB, on Mon Aug 29, 2011 4:34 PM, said:

LOL this is a exact copy of the Miller Graphic GPLLNK, well done!!!!

Sigh...

View PostWillsy, on Mon Aug 29, 2011 4:27 PM, said:

; This routine is based on the routine published in the July 1986 edition of 
; Smart Programmer. Modified by yours truly to allow it be executed from ROM.

However, RXB is not an exact copy of XB. - For instance it has an R. Come on, say it, Rrrrrrrr ...

Actually RXB is the XB source code I bought from Jim Leasher and he sold them to me as he did not know what they were, but knew they were GPL and there other was the XB Source code of the XB ROMs.

So actually RXB is exactly XB code with GKXB loaded then my modifications loaded on that. This is why if you want a listing of XB you should look at my GPL code of XB. (I put a * RXB PATCH CODE * before my code changes)

I paid $350.00 for one book (XB source code) and $250 for the other (XB ROM source) and this is where I got most of my ideas for RXB. (Originally named Rich GKXB) Super XB name was taken already along with someone that had a Ultimate XB.

RXB stands out as the only XB product totally based on the Source code so changes in the code are better debugged then the patched versions.




0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users