Searching \ for '[PIC]: String macro parameters' in subject line. ()
Make payments with PayPal - it's fast, free and secure! Help us get a faster server
FAQ page: www.piclist.com/techref/microchip/devices.htm?key=pic
Search entire site for: 'String macro parameters'.

Exact match. Not showing close matches.
PICList Thread
'[PIC]: String macro parameters'
2002\10\23@035818 by Jason Harper

picon face
Is there some MPASM technique I'm overlooking that would allow a macro to
take a string as a parameter, and split it up into characters?  I'd like to
call a macro like this:
       TEXT "Hello"
and have it expand to:
       sublw 'H'
       sublw 'e'
       sublw 'l'
       sublw 'l'
       sublw 'o'
(and yes, I DO have a reason for doing exactly that, as strange as it might
seem).  I really don't want to have to write this as:
       TEXT5 'H','e','l','l','o'
...if only because I'd have to define versions of the macro for every
possible length of string I might use (unless there's some trick for doing
variadic macros?).
       Jason Harper

--
http://www.piclist.com hint: To leave the PICList
spam_OUTpiclist-unsubscribe-requestTakeThisOuTspammitvma.mit.edu


2002\10\23@041112 by Alan B. Pearce

face picon face
>Is there some MPASM technique I'm overlooking that would allow
>a macro to take a string as a parameter, and split it up into
>characters?  I'd like to call a macro like this:

Well the DT operator will do what you want, but the instruction is always
RETLW.

So if you do

   DT "Hello"

it converts it to

   RETLW "H"
   RETLW "e"

 etc.

This is the only way to do it that I know off hand.

--
http://www.piclist.com hint: To leave the PICList
.....piclist-unsubscribe-requestKILLspamspam@spam@mitvma.mit.edu


2002\10\23@075346 by Olin Lathrop

face picon face
>>
       TEXT "Hello"
and have it expand to:
       sublw 'H'
       sublw 'e'
       sublw 'l'
       sublw 'l'
       sublw 'o'
<<

This can be done.

That's all I'll say until you fix your message format to stop using quoted
printable.  What part of PLAIN TEXT do you find difficult to grasp!!?


*****************************************************************
Embed Inc, embedded system specialists in Littleton Massachusetts
(978) 742-9014, http://www.embedinc.com

--
http://www.piclist.com hint: To leave the PICList
piclist-unsubscribe-requestspamKILLspammitvma.mit.edu


2002\10\23@081224 by Jason Harper

picon face
Olin Lathrop wrote:
> This can be done.
>
> That's all I'll say until you fix your message format to stop using
quoted
> printable.  What part of PLAIN TEXT do you find difficult to grasp!!?

There's nothing I can do about the format of my messages without completely
changing how I deal with email, in other words at least as much effort as
it would take for you to deal with this so-called problem at your end.
Given that quoted-printable is a perfectly normal, standard way of sending
Internet email, I consider the burden of dealing with it entirely yours.

What part of NOT BEING A TOTAL ASSHOLE WHO INSISTS THAT EVERYONE PLAYS BY
HIS RULES do you find difficult to grasp!!?
       Jason Harper

--
http://www.piclist.com hint: To leave the PICList
.....piclist-unsubscribe-requestKILLspamspam.....mitvma.mit.edu


2002\10\23@084413 by c Scheepers

flavicon
face
Thanks Jason,

I needed this because I refrained from sending messages cause my
environment which I work in  (Outlook 2002 in corporate environment )
does not allow me to send any other format. I am stuck with quoted
printable and I think Olin just has to live with it cause I like this
list. I will still try to find a solution and post it if I get it but I
think for now it will have to do.

:-)

{Original Message removed}

2002\10\23@085623 by Jennifer L. Gatza

flavicon
face
My mail server automatically converts quoted-printable to 8-bit, and I have
no problem reading/replying:

Content-Transfer-Encoding: 8bit
X-MIME-Autoconverted: from quoted-printable to 8bit by myers.adgrafix.com id
IAA17127

Several software tools are available to convert MIME types at the receiving
end, if this is an option for those who are already extremely busy. If it is
too much trouble to convert or adapt, then, well... that's another issue
that's already been beaten to death.

Jen

< various complaints and ramblings about encoding type omitted >

--
http://www.piclist.com hint: To leave the PICList
EraseMEpiclist-unsubscribe-requestspam_OUTspamTakeThisOuTmitvma.mit.edu


2002\10\23@092323 by Dave Tweed

face
flavicon
face
Olin Lathrop <olin_piclistspamspam_OUTEMBEDINC.COM> wrote:
> That's all I'll say until you fix your message format to stop using quoted
> printable.  What part of PLAIN TEXT do you find difficult to grasp!!?

Olin, I can't believe you're still flaming people over this, right after
you sent out this unreadable mess:

{Quote hidden}

I recommend that you drop this issue and learn to deal with
quoted-printable messages internally. How hard can it be to write
a simple filter that will take care of this once and for all?

-- Dave Tweed

--
http://www.piclist.com hint: To leave the PICList
@spam@piclist-unsubscribe-requestKILLspamspammitvma.mit.edu


2002\10\23@101942 by myke predko

flavicon
face
Olin wrote:


>         TEXT "Hello"
> and have it expand to:
>         sublw 'H'
>         sublw 'e'
>         sublw 'l'
>         sublw 'l'
>         sublw 'o'
> <<
>
> This can be done.

I would be very interested in seeing how you could do this - because this is
something that I have wanted to do over the years and I didn't think that it
was possible with the limited directives in MPASM.

Thanx,

myke

--
http://www.piclist.com hint: To leave the PICList
KILLspampiclist-unsubscribe-requestKILLspamspammitvma.mit.edu


2002\10\23@103227 by Dale Botkin

flavicon
face
All right, ENOUGH.

For those of you using various oddball encoding methods: The vast majority
of people using this list find a way to send plain ASCII text email, as is
the list policy and as is generally accepted practice for lists and
newsgroups.  Don't complain when people don't like it, there are ways to
deal with it.

For Jason:  Your childish name-calling on a public list is TOTALLY
inappropriate, and a clear violation of the list rules, which I suggest
you review.  If it's repeated, ever, I will personally bounce you off the
list without further warning or comment.

For Olin:  Some people can't or won't change how they do things.  Sad, but
true, and it happens all over and not just on this list.  If you're going
to not respond to someone's question based on how their message is
formatted, fine, but refuse silently.  We really do not need to be
notified every time you're unhappy about something, I already have a full
time job.

For everyone:  Let's have some degree of civility and courtesy on the
list, please.  This sort of petty bickering back and forth is a complete
waste of time and bandwidth, and I don't have any patience for it any
more.

Dale
---
PICList Admin #4

--
http://www.piclist.com hint: To leave the PICList
RemoveMEpiclist-unsubscribe-requestTakeThisOuTspammitvma.mit.edu


2002\10\23@113839 by Olin Lathrop

face picon face
> My mail server automatically converts quoted-printable to 8-bit, and I
have
> no problem reading/replying:
>
> Content-Transfer-Encoding: 8bit
> X-MIME-Autoconverted: from quoted-printable to 8bit by myers.adgrafix.com
id
> IAA17127

Do you know if Outlook Express can be set up to do this automatically, or
add the "> " in front of replies like it does for plain text messages?


*****************************************************************
Embed Inc, embedded system specialists in Littleton Massachusetts
(978) 742-9014, http://www.embedinc.com

--
http://www.piclist.com hint: To leave the PICList
spamBeGonepiclist-unsubscribe-requestspamBeGonespammitvma.mit.edu


2002\10\23@114636 by Olin Lathrop

face picon face
> Olin, I can't believe you're still flaming people over this, right after
> you sent out this unreadable mess:
>
> > Content-Type: application/octet-stream;
> >         name="picprg_id.pas"
> > Content-Transfer-Encoding: quoted-printable
> > Content-Disposition: attachment;
> >         filename="picprg_id.pas"

Hmm, so that message DID get out.  I have tried three times to reply to
Wouter.  One time it got bounced back because it exceed the 1000 line limit.
The second time I tried with a smaller attachment last night, and again this
morning.  I haven't gotten any of those messages back, although I've gotten
other messages I've posted back.  Very strange.  I was going to try again
later without an attachment, but I won't now that I know at least one of the
messages did get distributed after all.

By the way, the "mess" in this case is forced because of the attachment.


*****************************************************************
Embed Inc, embedded system specialists in Littleton Massachusetts
(978) 742-9014, http://www.embedinc.com

--
http://www.piclist.com hint: To leave the PICList
TakeThisOuTpiclist-unsubscribe-requestEraseMEspamspam_OUTmitvma.mit.edu


2002\10\23@115045 by Olin Lathrop

face picon face
> >         TEXT "Hello"
> > and have it expand to:
> >         sublw 'H'
> >         sublw 'e'
> >         sublw 'l'
> >         sublw 'l'
> >         sublw 'o'
> > <<
> >
> > This can be done.
>
> I would be very interested in seeing how you could do this - because this
is
> something that I have wanted to do over the years and I didn't think that
it
> was possible with the limited directives in MPASM.

Just use the DT directive instead of trying to make a macro for it.

I imagine you could make a macro that just contains the DT directive, but I
haven't tried that.  This assumes that string parameters to MPASM macros
aren't broken - I don't think I've ever tested that.


*****************************************************************
Embed Inc, embedded system specialists in Littleton Massachusetts
(978) 742-9014, http://www.embedinc.com

--
http://www.piclist.com hint: To leave the PICList
RemoveMEpiclist-unsubscribe-requestspamTakeThisOuTmitvma.mit.edu


2002\10\23@120055 by Alan B. Pearce

face picon face
>Do you know if Outlook Express can be set up to do this automatically, or
>add the "> " in front of replies like it does for plain text messages?

The only way I have found to add the ">" automatically is to automatically
quote the whole message when replying, and we have enough of that already
:))))))

I do wish OE had some more options in this area, it really would make it
much more user friendly.

--
http://www.piclist.com hint: To leave the PICList
piclist-unsubscribe-requestEraseMEspam.....mitvma.mit.edu


2002\10\23@120301 by Alan B. Pearce

face picon face
>The second time I tried with a smaller attachment last night,
>and again this morning.  I haven't gotten any of those messages
>back, although I've gotten other messages I've posted back.
>Very strange.

I received both the last two messages you posted with attachments.

What you are seeing is what others of us see every so often with missing
messages, I suspect.

--
http://www.piclist.com hint: To leave the PICList
EraseMEpiclist-unsubscribe-requestspammitvma.mit.edu


2002\10\23@120724 by Olin Lathrop

face picon face
> The only way I have found to add the ">" automatically is to automatically
> quote the whole message when replying, and we have enough of that already
> :))))))

That's what I have it do.  I then cut out the irrelevant parts and add my
reply.  That's easy enough and I have no problem with that.

The problem is that OE won't quote the whole message when the original was
encoded quoted printable, but it does do it correctly when the original was
plain text.  Any idea how to get around that?

> I do wish OE had some more options in this area, it really would make it
> much more user friendly.

Yes.  I'd like it to not wrap original replying-to lines.


*****************************************************************
Embed Inc, embedded system specialists in Littleton Massachusetts
(978) 742-9014, http://www.embedinc.com

--
http://www.piclist.com hint: To leave the PICList
RemoveMEpiclist-unsubscribe-requestEraseMEspamEraseMEmitvma.mit.edu


2002\10\23@121758 by myke predko

flavicon
face
Olin,

From your original reply, it sounded like you knew of a way to parse a
string and pass individual characters to specific statements in the format
that was originally asked:


{Quote hidden}

A macro that can convert a parameter string to a DT statement is pretty
simple - I (and the original poster) was hoping for something a bit more
arbitrary.

Thanx anyway,

myke

--
http://www.piclist.com hint: To leave the PICList
RemoveMEpiclist-unsubscribe-requestspam_OUTspamKILLspammitvma.mit.edu


2002\10\23@131200 by Peter L. Peres

picon face
On Wed, 23 Oct 2002, Alan B. Pearce wrote:

*>>Do you know if Outlook Express can be set up to do this automatically, or
*>>add the "> " in front of replies like it does for plain text messages?
*>
*>The only way I have found to add the ">" automatically is to automatically
*>quote the whole message when replying, and we have enough of that already
*>:))))))
*>
*>I do wish OE had some more options in this area, it really would make it
*>much more user friendly.

I think it will quote what you highlight if you highlight anything. I am
not using Allesschluck.

Peter

--
http://www.piclist.com hint: To leave the PICList
RemoveMEpiclist-unsubscribe-requestTakeThisOuTspamspammitvma.mit.edu


2002\10\23@132335 by Albert Clark

flavicon
face
GOOD FOR YOU JASON

--
http://www.piclist.com hint: To leave the PICList
EraseMEpiclist-unsubscribe-requestspamspamspamBeGonemitvma.mit.edu


2002\10\23@134713 by Sergio Masci

picon face
----- Original Message -----
From: myke predko <RemoveMEmykeKILLspamspamPASSPORT.CA>
To: <PICLISTSTOPspamspamspam_OUTMITVMA.MIT.EDU>
Sent: Wednesday, October 23, 2002 5:17 PM
Subject: Re: [PIC]: String macro parameters


{Quote hidden}

Depends on the assembler, in xcasm you could write

Unoptimised

       foo       .macro    arg

       xlen      .set        STRLEN(arg)
       indx      .set        0

                   .while     indx < xlen
                   sublw     INT(SUBSTR(arg, indx, 1))
       indx     .set         indx + 1
                  .done

                  .endm

Optimised

       foo       .macro    arg

       xlen      .set        STRLEN(arg)
       indx      .set        0
       xacc     .set        0

                   .while     indx < xlen
       xacc     .set        xacc + INT(SUBSTR(arg, indx, 1))
       indx     .set         indx + 1
                  .done

                   sublw     xacc & $ff

                  .endm

Regards
Sergio Masci

--
http://www.piclist.com hint: To leave the PICList
spamBeGonepiclist-unsubscribe-requestSTOPspamspamEraseMEmitvma.mit.edu


2002\10\23@135028 by Sergio Masci

picon face
----- Original Message -----
From: Olin Lathrop <KILLspamolin_piclistspamBeGonespamEMBEDINC.COM>
To: <EraseMEPICLISTspamEraseMEMITVMA.MIT.EDU>
Sent: Wednesday, October 23, 2002 5:06 PM
Subject: Re: [PIC]: String macro parameters

[snip]

Actually Olin I completely agree with you regarding non-plain text postings.

It's stated in The list posting requirements somewhere.

Using high level protocols is do-able but is often a complete waste of time,
money and bandwidth.

I few years ago I worked on a system that used XML as the message protocol.
Two complex pieces of software needed to communicate over international
links. The messages were a minimum of 10k each (only 5 types of messages
could be sent or received). The total usable information that we could
extract came down to a few bits in most of the messages and several 3 or 5
character codes in the rest. The machines needed to process all the chaff
(hundreds of thousands of messages a day) were monsters. The pointy haired
bosses added all sorts of caching to reduce (expensive) network traffic.

We, the users of the PICLIST, are supposed to be technically savvy people.
We are supposed to understand the impact of adding an extra instruction to a
microcontroller timing loop, or the benefits of using fixed point over
floating point. If we abandon the plain text requirement, how long before
html becomes the standard?

Here's a thought, all those who feel aggrieved by not being allowed to use
high level message formats such as html should get together and create a new
list. This would benefit both lists. We would only see plain text and you
wouldn't get people like Olin bitching at you. Hey, there'll be more time
for him to answer my questions ;-)

Sergio Masci

--
http://www.piclist.com hint: To leave the PICList
@spam@piclist-unsubscribe-request@spam@spamspam_OUTmitvma.mit.edu


2002\10\23@143500 by c Scheepers

flavicon
face
And less people to respond to your questions!!

-----Original Message-----
From: Sergio Masci [spamBeGonesmplspamKILLspamNTLWORLD.COM] Sent: 23 October 2002 07:56
To: .....PICLISTspam_OUTspamMITVMA.MIT.EDU
Subject: Re: [PIC]: String macro parameters

----- Original Message -----
From: Olin Lathrop <TakeThisOuTolin_piclist.....spamTakeThisOuTEMBEDINC.COM>
To: <TakeThisOuTPICLISTKILLspamspamspamMITVMA.MIT.EDU>
Sent: Wednesday, October 23, 2002 5:06 PM
Subject: Re: [PIC]: String macro parameters

[snip]

Actually Olin I completely agree with you regarding non-plain text
postings.

It's stated in The list posting requirements somewhere.

Using high level protocols is do-able but is often a complete waste of
time,
money and bandwidth.

I few years ago I worked on a system that used XML as the message
protocol.
Two complex pieces of software needed to communicate over international
links. The messages were a minimum of 10k each (only 5 types of messages
could be sent or received). The total usable information that we could
extract came down to a few bits in most of the messages and several 3 or
5
character codes in the rest. The machines needed to process all the
chaff
(hundreds of thousands of messages a day) were monsters. The pointy
haired
bosses added all sorts of caching to reduce (expensive) network traffic.

We, the users of the PICLIST, are supposed to be technically savvy
people.
We are supposed to understand the impact of adding an extra instruction
to a
microcontroller timing loop, or the benefits of using fixed point over
floating point. If we abandon the plain text requirement, how long
before
html becomes the standard?

Here's a thought, all those who feel aggrieved by not being allowed to
use
high level message formats such as html should get together and create a
new
list. This would benefit both lists. We would only see plain text and
you
wouldn't get people like Olin bitching at you. Hey, there'll be more
time
for him to answer my questions ;-)

Sergio Masci

--
http://www.piclist.com hint: To leave the PICList
.....piclist-unsubscribe-requestspamRemoveMEmitvma.mit.edu

--
http://www.piclist.com hint: To leave the PICList
RemoveMEpiclist-unsubscribe-requestspamspamBeGonemitvma.mit.edu


2002\10\23@151731 by Dale Botkin

flavicon
face
On Wed, 23 Oct 2002, Nic Scheepers wrote:

> And less people to respond to your questions!!

But perhaps those remaining will be able to trim their flippin' replies a
little.

--
http://www.piclist.com hint: To leave the PICList
spamBeGonepiclist-unsubscribe-request@spam@spamspam_OUTmitvma.mit.edu


2002\10\23@162545 by Dwayne Reid

flavicon
face
At 07:53 AM 10/23/02 -0400, Olin Lathrop wrote:

>That's all I'll say until you fix your message format to stop using quoted
>printable.  What part of PLAIN TEXT do you find difficult to grasp!!?

Umm . . .

The following is a snippet from the header of his message:

MIME-Version: 1.0
Content-Type: text/plain; charset=ISO-8859-1
Content-Disposition: inline
Message-ID:  <TakeThisOuT200210230355_MC3-1-16F5-F597spamspamcompuserve.com>

This tells me a couple of things: he *is* using plain text and he is using
Compuserve.  I know from past experience that Compuserve does things
somewhat differently but most competent mail readers should be able to
handle his message properly.  Eudora seems to have no problem with it.

dwayne

--
Dwayne Reid   <dwaynerEraseMEspamplanet.eon.net>
Trinity Electronics Systems Ltd    Edmonton, AB, CANADA
(780) 489-3199 voice          (780) 487-6397 fax

Celebrating 18 years of Engineering Innovation (1984 - 2002)
 .-.   .-.   .-.   .-.   .-.   .-.   .-.   .-.   .-.   .-
    `-'   `-'   `-'   `-'   `-'   `-'   `-'   `-'   `-'
Do NOT send unsolicited commercial email to this email address.
This message neither grants consent to receive unsolicited
commercial email nor is intended to solicit commercial email.

--
http://www.piclist.com hint: To leave the PICList
RemoveMEpiclist-unsubscribe-requestEraseMEspamspam_OUTmitvma.mit.edu


2002\10\23@164015 by Olin Lathrop

face picon face
> MIME-Version: 1.0
> Content-Type: text/plain; charset=ISO-8859-1
> Content-Disposition: inline
> Message-ID:  <@spam@200210230355_MC3-1-16F5-F597RemoveMEspamEraseMEcompuserve.com>
>
> This tells me a couple of things: he *is* using plain text

No, he's not.  Here is are ALL the relevant lines copied and pasted as a
single block directly from the original email message:

MIME-Version: 1.0
Content-Transfer-Encoding: quoted-printable
Content-Type: text/plain; charset=ISO-8859-1
Content-Disposition: inline
Message-ID:  <EraseME200210230355_MC3-1-16F5-F597spam@spam@compuserve.com>


*****************************************************************
Embed Inc, embedded system specialists in Littleton Massachusetts
(978) 742-9014, http://www.embedinc.com

--
http://www.piclist.com hint: To leave the PICList
@spam@piclist-unsubscribe-requestspam_OUTspam.....mitvma.mit.edu


More... (looser matching)
- Last day of these posts
- In 2002 , 2003 only
- Today
- New search...