piclist 2002\12\11\120732a >
Thread: String Copy in ASM
picon face BY : Spehro Pefhany email (remove spam text)

At 10:12 AM 12/11/02 -0500, you wrote:
{Quote hidden}

If you are using C-like null-terminated strings you'll want to write
the terminating null into the target string. You can check for the
null after it is written.

{Quote hidden}

Yes, that's essentially what you'll have to do, as the PIC only has
one index register, you'll have to share it. It's even uglier because
everything has to go through W, so you need another temp location, as
you say, to hold the data. About a dozen instructions total, and about 13
cycles per byte copied, including the terminating null, unless there is
some trick I've missed (like the one I see that Tony has just mentioned,
which isn't general, but a neat trick nonetheless). Similarly you might
be able to do something with flipping bits of the FSR if the string origins
were appropriately aligned, which could leave w intact until it's

Best regards,

Spehro Pefhany --"it's the network..."            "The Journey is the reward"
spamspeffTakeThisOuTspaminterlog.com             Info for manufacturers: http://www.trexon.com
Embedded software/hardware/analog  Info for designers:  http://www.speff.com

http://www.piclist.com#nomail Going offline? Don't AutoReply us!
email listservspam.....mitvma.mit.edu with SET PICList DIGEST in the body


In reply to: <NEBBKHCEJKEEDIAOMMENEEFDHEAA.DFansler@MindSpring.com>
See also: www.piclist.com/techref/microchip/languages.htm?key=asm
Reply You must be a member of the piclist mailing list (not only a www.piclist.com member) to post to the piclist. This form requires JavaScript and a browser/email client that can handle form mailto: posts.
Subject (change) String Copy in ASM

month overview.

new search...