Truncated match.
PICList
Thread
'Building Text Strings in 16F84'
2000\03\05@221315
by
Tom Wehn
Hi all!
I am new to PICs (like the 16F84 didn't give it away). I would like to be
able to add a 5 digit number to a text string in memory. It seems to me I
should be able to #DEFINE a string with 00.000 for the number, then replace
it in memory. Problem is I have been unable to find the start of the
string. Am I on the right path here? Are strings that strange or is it me?
Thanks!!
Tom
2000\03\06@021102
by
piclist.com
Not quite sure what you are talking about. Do you mean "append the
conversion from binary to decimal ASCII of a number to a string in memory"?
If you are trying to convert a binary number to a text ASCII string, see:
http://www.piclist.com/faq
under Routines, Math, Base conversions.
PICs don't really do strings. They sort of do arrays (limited to a few
hundred 8 bit values via IND and indexed by the FSR) and if you have an
array that happens to be filled with ASCII values, you sort of have a
string. If you place the result of your number conversion just after that
array in memory, then you have appended it. But there are no string
processing or IO functions unless you program the PIC in a higher level
language like C.
What are you really trying to accomplish?
James Newton, PICList Admin #3
spam_OUTjamesnewtonTakeThisOuT
piclist.com
1-619-652-0593 phone
http://www.piclist.com
{Original Message removed}
2000\03\06@062640
by
Caisson
|
> Van: Tom Wehn <.....tomwehnKILLspam
@spam@EN.COM>
> Aan: PICLIST
KILLspamMITVMA.MIT.EDU
> Onderwerp: Building Text Strings in 16F84
> Datum: maandag 6 maart 2000 4:11
>
> Hi all!
Hello Tom,
> I am new to PICs (like the 16F84 didn't give it away). I would like to be
> able to add a 5 digit number to a text string in memory. It seems to me I
> should be able to #DEFINE a string with 00.000 for the number, then
replace
> it in memory. Problem is I have been unable to find the start of the
> string. Am I on the right path here? Are strings that strange or is it
me?
It's You :-)
a #DEFINE does not allocate any memory (in ROM or RAM), but tell's your
assembler to replace the first string behind the #DEFINE by the second,
wherever he find's it in the source-file. When you want to define som
*constant* strings or numbers, you will have to use the "dt" opcode.
Example:
Label1 dt "Hello world",0 ; A Zero-terminated string (in the Program-ROM
!)
LabelA dt 123,'a',255 ;Multiple byte's (in the Program-ROM !)
If you want to create a "template" number, and want to change it's
content's, you will have to store all bytes one-by-one into the RAM-area.
Regards,
Rudy Wieser
2000\03\06@070449
by
Tom Wehn
|
>Not quite sure what you are talking about. Do you mean "append the
>conversion from binary to decimal ASCII of a number to a string in memory"?
>
>
>PICs don't really do strings. They sort of do arrays (limited to a few
>hundred 8 bit values via IND and indexed by the FSR) and if you have an
>array that happens to be filled with ASCII values, you sort of have a
>string. If you place the result of your number conversion just after that
>array in memory, then you have appended it.
>What are you really trying to accomplish?
I have an 8 channel AD converter, a couple of op amps and a LCD wired to
make a Voltage, Current, and Watt monitor. So far I have written the serial
interterface for the AD, 16 bit math, keyboard and LCD routines. And I owe
it all the Piclist! All I want is to be able to build a string that reads
"Starting Volts 12.345" in memory so I can scroll several lines of data up
and down in the LCD. Now I am outputting a string and then the number. If I
could change that to a series of continuous memory locations it would help.
Thanks again!
Tom
2000\03\06@161609
by
jamesnewton
More... (looser matching)
- Last day of these posts
- In 2000
, 2001 only
- Today
- New search...