PDA

View Full Version : Interpret a string


dnlblack
05-28-05, 12:37 PM
Is there a way to execute/interpret a string.
If the string is say "65 CCHR !"
This string would store "A" ie character 65 to CCHR

RMDumse
05-28-05, 02:30 PM
Yes. The word EVALUATE takes an address of a counted string and executes whats in it.

dnlblack
05-28-05, 02:38 PM
My ServoPod says "EVALUATE ?"

RMDumse
05-28-05, 08:05 PM
I think EVALUATE has been in IsoMax(TM) since last year, so you might want to upgrade to the latest version.

However... here is the source that will allow it to be added. I think I misspoke about the counted string. It seems to take an address and a count on the stack.


\ IsoMax EVALUATE

\ INTERPRET uses variables TIB (buffer address) and >IN (scan offset,
\ starting at zero) for the input. #TIB holds the length of the input.
\ These all need to be preserved so that INTERPRET can act on a different
\ string.

: EVALUATE ( addr n -- )
TIB @ >R >IN @ >R #TIB @ >R
2DUP + 0 SWAP C! \ append a null terminator, required by INTERPRET
#TIB ! TIB ! 0 >IN !
INTERPRET
R> #TIB ! R> >IN ! R> TIB ! ;

dnlblack
05-28-05, 09:47 PM
Someone who knows about which they speak!!!

Thank you for the info.

I have V0.6 but no Evaluate
Does 0.61 have it?
Is it worth the upgrade since I can include it.

Sorry I didn't notice that this topic was covered before.

RMDumse
05-31-05, 12:24 PM
I have V0.6 but no Evaluate
Does 0.61 have it?

There is a very very minor change between .6 and .61. So no, I don't think so.

Is it worth the upgrade since I can include it.

I think EVALUATE came in around V.66, but I'm not absolutely sure.

Yes, the most important change between V.61 and V.82 is we finally found a bug that had been annoying us for a long time, where the foreground and background would collide. For instance, if you were running chains in the background, and printing in the foreground, the system would occassionally crash. This turned out to be a problem deeply embedded in our development package, that gave us library routines which weren't re-entrant (grrrrrrrrrrrr! thanks Code Warrior... not.)

Anyway, that is cleared up, and many improvements have also been added to the language. So yes, I'd highly recommend upgrading to the latest.

cmmffhc
05-31-05, 08:06 PM
where can i get the upgrade?

ngkdc
05-31-05, 10:45 PM
Hi Randy,

That was my question as well ... I'm assuming you've updated the ServoPod firmware as well?

Regards,

Rick

nmitech
06-01-05, 02:34 PM
I am out of the office right now. Please email sales, nmisales@newmicros.com or production, nmiproduction@newmicros.com , or call 214-339-2204. They will be able to assist you with the upgrade .

ngkdc
06-02-05, 03:23 PM
Did that, got it, works great. Thanks!


Rick

dnlblack
06-07-05, 03:19 PM
Finally got the upgrade V0.82. Works great.
Now, where can I get an up to date isomax manual ?
For things like, the baud is now 115200.
can sci1 be set to 115200 also? If so,how?

nmitech
06-08-05, 09:02 AM
dnlblack, the IsoMax documents & appnotes on the 'Pod(TM) download page can be used for all 'Pods(TM) . Please check the link below for any latest update,
http://www.newmicros.com/store/product_details/download.html

Change the ServoPod SCI1 baudrate,
HEX 16 1310 ! ( select 115200 baud in Baud register )

Where 1310 is SCI1 Baud Rate Register, SCI1BR
16 is the SBR bit,
SCI Baud Rate = SCI module clock/(16 x SBR)

All the magic numbers above can be found from the DSP56F80x document. The link to this document is also available on the 'Pod(TM) download page,
http://www.freescale.com/files/dsp/doc/user_guide/DSP56F801-7UM.pdf