Jump to content
IGNORED

TI Floating point range


Willsy

Recommended Posts

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

Link to comment
Share on other sites

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

Link to comment
Share on other sites

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

Link to comment
Share on other sites

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 .

Link to comment
Share on other sites

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
;]

Link to comment
Share on other sites

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!!!!

Link to comment
Share on other sites

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

Link to comment
Share on other sites

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).

Link to comment
Share on other sites

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.

Link to comment
Share on other sites

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

 

Sigh...

 

; 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.

Link to comment
Share on other sites

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

 

Sigh...

 

; 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 ...

Link to comment
Share on other sites

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

 

Sigh...

 

; 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.

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...