??? 05/15/06 09:12 Read: times |
#116202 - are you sure this is OK? Responding to: ???'s previous message |
I have downloaded the sources and found the section you are talking about, which is now: mov r0,#026h ; bytes to copy 26h-1 ;mov r1,#026h ; lower byte of destination address mov dptr,#monstart ; DPTR points into my Flash copyirqs: mov A,r0 ; load offset into my original table movc A,@A+dptr ; get byte from code space mov P2,#HIGH(resetvector) ; set upper byte of reset vector to the XRAM bus movx @r0,A ; lower byte on bus = offset - write the byte from CODE space there dec r0 ; decrement destination pointer djnz r0,copyirqs ; loop for all bytes in charge You decrement r0 twice per loop, thus copying only the even address bytes (each other). Also, you won't copy byte at address 0, is this OK? You might want to use some sort of '51 simulator to check your code snippets... Jan Waclawek PS. Code memory optimisation hint: in the SFR read/write, don't jump into a jump table, jump immediately into the doce (array of mov A,SFR; ret) - you can spare down the jumptable. |
Topic | Author | Date |
interrupt table copy | 01/01/70 00:00 | |
optimisation | 01/01/70 00:00 | |
yes i had that in mind but... | 01/01/70 00:00 | |
No P2 worries | 01/01/70 00:00 | |
thanks for making this clear! | 01/01/70 00:00 | |
single chip solutions | 01/01/70 00:00 | |
Ofcourse | 01/01/70 00:00 | |
Why does it need optimising? | 01/01/70 00:00 | |
Not necessarily! | 01/01/70 00:00 | |
are you sure this is OK? | 01/01/70 00:00 | |
THANKS! | 01/01/70 00:00 | |
>256 byte long table | 01/01/70 00:00 | |
I'll give it a go... | 01/01/70 00:00 | |
worked! | 01/01/70 00:00 | |
Re: >256 byte long table | 01/01/70 00:00 | |
not quite this issue | 01/01/70 00:00 | |
issue resolved![]() | 01/01/70 00:00 |