| ??? 02/17/04 22:17 Read: times |
#64975 - RE: Question about program Responding to: ???'s previous message |
Lisa Hansen:
A bit of a brute force method you tried huh? Do you have to put on a new tire on the front of the bike to travel for each new turn of the wheel? Of course not....the tire is good for many turns. Why don't you try to re-use the inner instructions that do the main part of the work in your program inside of a loop so the program is much smaller and more manageable. Look for example....here is a way move 32 bytes of the internal SRAM to the XRAM as a loop. After you look at this maybe you can adapt the loop concept to your problem. ; ;move 32 bytes of internal RAM starting at zero ;to XDATA space at 0800H. ; MOVIT: MOV R0, #0 ; pointer for start of IRAM MOV DPTR, #0800H ; pointer for start of XRAM MOV R2, #32 ; byte counter MOVLP: MOV A, @R0 ; get IRAM byte to A MOVX @DPTR, A ; move the byte to XRAM INC R0 ; increment the IRAM pointer INC DPTR ; increment the XRAM pointer DJNZ R2, MOVLP ; decrement loop count and jump ; ; if more still to be done ; ... program continues from here ; Michael Karas |
| Topic | Author | Date |
| Question about program | 01/01/70 00:00 | |
| RE: Question about program | 01/01/70 00:00 | |
| RE: Question about program | 01/01/70 00:00 | |
| RE: Question about program | 01/01/70 00:00 | |
| RE: Question about program | 01/01/70 00:00 | |
| RE: Question about program | 01/01/70 00:00 | |
| RE: Question about program | 01/01/70 00:00 | |
| RE: Question about program | 01/01/70 00:00 | |
| RE: Question about program | 01/01/70 00:00 | |
| RE: Question about program | 01/01/70 00:00 | |
| RE: Question about program | 01/01/70 00:00 | |
| RE: Question about program | 01/01/70 00:00 | |
RE: Question about program | 01/01/70 00:00 |



