piclist 2001\01\24\171641a >
Thread: Assembler 101 question...
face picon face BY : Olin Lathrop email (remove spam text)

>         org     0x000A
>         data    0x01, 0x02, 0x03, 0x04
> When you assemble it, starting at 000A, in code space, you get:
> 000A    0001
> 000B    0002
> 000C    0003
> 000D    0004
> How does one access this data? In other words how does one load the value
> from code space address 000A into the w register?

You don't, on most PICs at least.  On the 16Fxxx and 18xxx series you can do
"table read" to directly read program memory locations.  For most other PICs
you can only store data in program memory by encoding it into the immediate
field of some instructions.  RETLW is usually used for tables on these PICs.

Olin Lathrop, embedded systems consultant in Devens Massachusetts
(978) 772-3129, spamBeGoneolinspamspamBeGoneembedinc.com, http://www.embedinc.com

http://www.piclist.com hint: The PICList is archived three different
ways.  See http://www.piclist.com/#archives for details.

<001101c08653$1a2f5110$260bf6cd@pc> 7bit

See also: www.piclist.com/techref/microchip/devices.htm?key=pic
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) Assembler 101 question...

month overview.

new search...