Nice, but the string routine from z80 bits always returns 5 character strings, which is why I did it this way.
Very neat, very clean. I think that's just the way I would have done it myself. Wink
Smile I found that I'll be needing the routine as well, so far my OS can display text, bin, oct, and hex and i was too clearheaded to figure out decimal.Although, i pretty sure i once made a big deal over having found a way to convert to any base in z80 using 1 routine...I'll have to retrace the forum and see if i can't find it.

One thing that site doesnt have the routine for displaying ASCII formatted floating point numbers.Thats one thing I'll be needing, and I think you might need as well for those advanced math functions.
Anakclusmos wrote:
One thing that site doesnt have the routine for displaying ASCII formatted floating point numbers.Thats one thing I'll be needing, and I think you might need as well for those advanced math functions.

Those depend greatly on your floating point format. TI's format is fairly easy to display because it is stored in BCD (binary-coded decimal), but it is slower and takes more space than a straight binary floating-point format.
i wanna stick to ti's for compatability reasons.

Im still looking for that routine...
calc84maniac wrote:
TI's format is fairly easy to display because it is stored in BCD (binary-coded decimal), but it is slower and takes more space than a straight binary floating-point format.

It also makes sense to store numbers in decimal when the user will be dealing with numbers in decimal (e.g. a calculator). Binary may be faster for computers but can soon lead to problems (as demonstrated in BBC BASIC if you repeatedly add 0.1 - a value that can't be exactly represented in binary floating point - to a number).
Smile thats nice to know and all, but for compatability reasons I'd really rather stick to TI's format.If anyone knows a routine to display the ASCII format of a TI's floating point numbers id greatly appreciate it.
Anakclusmos wrote:
i wanna stick to ti's for compatability reasons.

Im still looking for that routine...
I'd say it is more rational to stick to IEEE 754-1985 for the sake of compatibility, since it's used infinitely more widely...
I don't have of a routine to display TI's floating-point number format, but as they're stored in packed BCD it should be extremely easy to output the mantissa (hint: it's exactly the same as outputting hex), and the exponent tells you when to insert the decimal point. You will probably want to tweak the exponent before displaying to display numbers in x.yEz form, depending on how exactly you'd like to format the numbers.
Razz gah i completely forgot tios's floating point numbers were like that.something like this might work...


Code:
OutFloatingpoint:
   ld a,(hl)
   sub $18
   ld c,10
   ld b,a
ofp_loop:
   inc hl
   ld a,(hl)
   call OutHexA
   dec c
   ld a,c
   or a
   ret z
   djnz ofp_loop
   ld a,'.'
   bcall(_putc)
   jr ofp_loop
It seems to me that you're missing a sign bit check and associated '-' display...?
i am. This was just an example off the top of my head though.I was focussing mainly on displaying the number and decimal
I need 2 routines, 1 that reads a byte from the link port and another that sends a byte to the link port. I suck at anything linkport related, so any help is appreciated. (unintentional rhyme)

EDIT:
If it means anything, I need the routine so I can write a routine to recieve a program from the computer
  
Register to Join the Conversation
Have your own thoughts to add to this or any other topic? Want to ask a question, offer a suggestion, share your own programs and projects, upload a file to the file archives, get help with calculator and computer programming, or simply chat with like-minded coders and tech and calculator enthusiasts via the site-wide AJAX SAX widget? Registration for a free Cemetech account only takes a minute.

» Go to Registration page
Page 2 of 2
» All times are UTC - 5 Hours
 
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum

 

Advertisement