Need little help in Spin coding
Sapieha
Posts: 2,964
Hi All
·
Help my.
·
I portar my C code to Propeler spin and can’t convert it to Spin.
·
while(*the_string !="\0")
·
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Sapieha
·
Help my.
·
I portar my C code to Propeler spin and can’t convert it to Spin.
·
while(*the_string !="\0")
·
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Sapieha
Comments
And I assume you mean '\0' rather than "\0"...
or
or
"the_string" is a pointer; don't forget to increment it (++)
Thanks
It is corect ????
repeat i from i to i < yme|i++
' for (i=0|i < yme|i++) ' // 10 bytes per char 15
'{ //
Mask := $80
j := x
repeat j from j to j < (x + xme)|j++
'for (j=x|j < (x + xme)|j++)
'{ //
z := y + i
' //
if (@Data & Mask)
'{ //
LCD_PixelPut (j,z,fcolor)
'} ' //
if not (@Data & Mask) ' else
'{ //
LCD_PixelPut (j,z,bcolor)
'} ' //
Mask>>=1
'} //
Data++
x+=xme
the_string++
'}
REPEAT WHILE BYTE[noparse][[/noparse]@the_string] == 0 ' //· while(@the_string !="\0") keep spitting chars until end
' //
SendLcd(LCDCommand,nNOP) '· //· Recomended to send now and then
Prppeller Tools compile it ! but I still not run it.
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Sapieha
Post Edited (Sapieha) : 9/15/2007 7:21:32 PM GMT
C has no nice for loops; SPIN has - please look into the manual
correct would be: REPEAT i FROM 0 TO yme-1
correct would be: REPEAT j FROM x TO x+yme-1
What do you want to say with "@Data" ???
Use ELSE by all means
This makes hardly any sense! Where is "the_string" incremented? You must use a pointer, to be de-referenced by BYTE[noparse][[/noparse]..]
Sorry I have not manual till Propeller spin Programing.
It is my first attemp to port my C code to spin.
I only learn mig from code on forum and I know att it looks bad.
Ps. Has not problem understand ASM coding but in ·spin I have little problem
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Sapieha
Post Edited (Sapieha) : 9/15/2007 7:56:16 PM GMT
Propeller IDE -> Help -> Propeller Manual
Chapter 3 is extraordinary good!
What do you want to say with "@Data" ???
It is Variable to hold temporary address to pixel table on every character
Where is "the_string" incremented?
one rad before repeat
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Sapieha
If I use else Propeler tools talking it
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Sapieha
This also makes no sense - it has do be done inside the repeat-loop.
Please post your code again; when you sorround it by "[noparse][[/noparse] code ]" and "[noparse][[/noparse] /code]" it will also look nice.
Thanks for help.
It is entire code of my PUB routin.
Look on picture
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Sapieha
Need little time to think Spin
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Sapieha
Post Edited (Sapieha) : 9/15/2007 8:58:03 PM GMT
I think about it but for it I most understand Spin programing.
And it take up little time
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Sapieha
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Sapieha
Look on attach code and give my acceptable solution if You wish.
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Sapieha