??? 03/12/04 05:55 Read: times |
#66557 - RE: I need help Responding to: ???'s previous message |
THE CODE I MADE IS A SUBROUTINE !!!!!!!
Set R6::R7 as a value from 0 through the size of the table then call the subroutine. It will return the element from the table at the R6::R7 specified location. If you want to access values sequentuially from some part of the table then you need a little more code in a loop of some type that calls the subroutine repeatedly. Through each iteration of the loop add 1 onto the R6::R7 value. Here is how it could be done... <pre> ; ; main program loop to read 31 bytes out of TABLE3 ; in sequence starting at index position 864. ; ACCESS_INDEX equ 864 ACCESS_COUNT equ 31 ; MOV R6, #HIGH(ACCESS_INDEX) ;setup table index MOV R7, #LOW(ACCESS_INDEX) MOV R2, #ACCESS_COUNT ;setup loop counter MY_LOOP: CALL LOOKUP3 ;get TABLE3[R6::R7] to A ; ;<< DO NEEDED THING WITH ACC BYTE >> ; MOV A, R7 ;increment R6::R7 ADD A, #1 MOV R7, A MOV A, R6 ADDC A, #0 MOV R6, A ; DJNZ R2, MY_LOOP ;decrement R2 loop counter ;and repeat loop till all ;bytes accessed ; ;<< NEXT PART OF PROGRAM GOES HERE :>> MICHAEL KARAS |
Topic | Author | Date |
C Programe for 8051 | 01/01/70 00:00 | |
Reading List | 01/01/70 00:00 | |
RE: Reading List | 01/01/70 00:00 | |
RE: C Programe for 8051 | 01/01/70 00:00 | |
Sorry for the new thread | 01/01/70 00:00 | |
I need help | 01/01/70 00:00 | |
Learning 'C' | 01/01/70 00:00 | |
RE: I need help | 01/01/70 00:00 | |
RE: I need help | 01/01/70 00:00 | |
RE: I need help | 01/01/70 00:00 | |
RE: C table lookup | 01/01/70 00:00 | |
RE: I need help | 01/01/70 00:00 | |
RE: I need help | 01/01/70 00:00 | |
RE: I need help | 01/01/70 00:00 | |
RE: I need help | 01/01/70 00:00 | |
RE: I need help | 01/01/70 00:00 | |
RE: I need help | 01/01/70 00:00 | |
RE: I need help | 01/01/70 00:00 | |
RE: I need help | 01/01/70 00:00 | |
RE: I need help | 01/01/70 00:00 | |
RE: I need help | 01/01/70 00:00 | |
RE: I need help | 01/01/70 00:00 | |
RE: I need help | 01/01/70 00:00 | |
RE: I need help | 01/01/70 00:00 | |
RE: I need help | 01/01/70 00:00 | |
RE: I need help | 01/01/70 00:00 | |
RE: I need help | 01/01/70 00:00 | |
RE: I need help | 01/01/70 00:00 | |
RE: I need help | 01/01/70 00:00 | |
RE: I need help | 01/01/70 00:00 | |
RE: I need help | 01/01/70 00:00 | |
RE: I need help | 01/01/70 00:00 | |
RE: I need help | 01/01/70 00:00 | |
RE: I need help | 01/01/70 00:00 | |
RE: I need help | 01/01/70 00:00 | |
RE: I need help![]() | 01/01/70 00:00 |