• Welcome to our site! Electro Tech is an online community (with over 170,000 members) who enjoy talking about and building electronic circuits, projects and gadgets. To participate you need to register. Registration is free. Click here to register now.

PIC - text strings into program memory

Status
Not open for further replies.

L0D|Mr_B

New Member
i'm using MPLAB, chip 16F84

i want to put some standard text into the program memory, so if someone reads the code it has "copyright Mr B" in it :D wots the command, i tried :-

dw "this is some text", but every odd character is replaced by a dot e.g. ".h.s.i. .o.e.t.x."

i dont think i'm either using the right command, or my syntax is incorrect. anyone know how to fix it?

B
 

Exo

Active Member
The command to do this is dt

dt "My message",0 for example

This will be replaced by a series of retlw instructions to create a lookup table
RETLW 'M'
RETLW 'y'
RETLW ' '
RETLW 'm' .......
 

L0D|Mr_B

New Member
i treid that just now -

dt "arse"

and it does the RETLW thing, but in hex all the text is still garbled :S
is there no way of doing it so all the memory uses my text, not half a block at a word at a time which is happenign now -

hex code is now 3461 3472 3473 - 4a4r4s <- i want arse not 4a4r4s etc.

:(

B
 

Exo

Active Member
you NEED the retlw thing :?

How else are you going to extract the text from the program memory without RETLW??
 

tommyc2000

New Member
1111

Guy, you got some weird fetish hahahah


retlw 63h, 6fh, 70h, 79h, 72h, 69h, 67h, 68h, 74h, 0h, 4dh, 52h, 0h, 42h, 0h
 

L0D|Mr_B

New Member
fetish?!

ok, this comment i'm putting in, it does not need to be accessed by the CPU, it's not used at all in the processing, i just want some text in there so if someone de-compiles my code, they are presented with a rude message :D

B
 

Exo

Active Member
lol, if somebody wants to understand your code they should ask the source.

Stupid way of wasting scarse pic memory if you ask me :?
 
Status
Not open for further replies.

Latest threads

EE World Online Articles

Loading
Top