You must be more specific. A linear array like above? A 2 x n
matrix? A jump table of funtion pointers? C? AssemblY?
.--------------------------------..--------------------------------.
| Mark A. Odell || Embedded Firmware Design, Inc. |
| Principal Consultant || 8051 Experts |
| http://www.embeddedfw.com || Real-time Specialists |
| || |
| .-----------------------------------------------. |
| / "When meeting all deadlines IS the requirement" \ |
| \_________________________________________________/ |
| || |
'--------------------------------''--------------------------------'
(Remove the obvious from reply address to respond via e-mail)
peens <pe...@icon.com> wrote in message news:7rb9kt$ni7$1...@ctb-nnrp2.saix.net...
You will have to do the pointer addition directly into the DPTR.
mov a,offsetLo
add a,dpl
mov dpl,a
mov a,offsethi
addc a,dph
mov dph,a
or just:
inc dptr
if you are walking through a table ....
you can configure your hardware to use RAM as code space if you wish with a
couple of gates.
phil <ph...@extreme-measures.com> wrote in message
news:nTbC3.861$8Y4....@alfalfa.thegrid.net...
It depends on what you want to do an on which MCU
Cass <casseg...@galaxycorp.com> writes
/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\
\/\/\/\/\/\ Chris Hills Staffs /\/\/\/\/\/
/\/\/\/\/\/\/\/\/\ England /\/\/\/\/\/\/\/\
\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/
>
>some versions of the 8051 have eight DPTRs
>
Out of curiousity, who makes one with 8?
Tom
Jon Ward
Keil Software
Tom Maier wrote in message <37dd65af...@news.bitstorm.net>...
The Siemens range based on the C500 core.
Jon Ward <jo...@keil.com> writes
>The Siemens/Infineon 515 and 517
>Jon Ward
>Keil Software
>
>Tom Maier wrote in message <37dd65af...@news.bitstorm.net>...
>>Chris Hills <ch...@phaedsys.demon.co.uk> wrote:
>>>some versions of the 8051 have eight DPTRs
>>Out of curiousity, who makes one with 8?
/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\
Bryan Whitton
Here's another way:
(in asm)
If, for any reason, you don't want to use the DPTR and you don't have any
other data pointers, you can use the zero-page addressing mode for tables <=
256 bytes. (If the table is in RAM)
e.g. MOV A,@R0 (internal RAM)
or MOVX A,@R0 (external RAM)
For external RAM, port P0 and P2 will be used by the CPU to access the
external memory. Because the "@Ri" addressing mode is an 8-bits mode, the
instruction will cause port P2's value (the high-byte) to stay at the
external addressbus. You can use this feature to address a certain
memory-page.
(Note: normally port P2 will be 0 by default, so you will access the
external zero-page.)
For example:
You have located a table at external RAM address 0500h and you want to
address the 23rd element, you can do this by:
MOV P2,#5 ;High byte of external address
MOV R0,#23 ;Index into table (low byte of external address)
MOV A,@R0 ;Read the table !!i!
I've used this feature to create a second datapointer to make block-moves
and bit-blitting very fast on the stupid old 8051.
I don't know if this is usefull to you. Bye !
Henk Dekker