| ??? 12/28/01 02:58 Read: times |
#18143 - RE: Part 2:To code a jmp table properly |
Spencer,
The following is straight out of the manual (a useful reference); http://www.atmel.com/atmel/acrobat/doc0497.pdf it indicates: "In a 5-way branch, for example, an integer 0 through 4 is loaded into the Accumulator. The code to be executed might be as follows. MOV DPTR, # JUMP__TABLE MOV A,INDEX__NUMBER RL A JMP @A+ DPTR JUMP__TABLE: AJMP CASE__0 AJMP CASE__1 AJMP CASE__2 AJMP CASE__3 AJMP CASE__4 " It looks like you are are duplicating "ajmp" instructions needlessly, also the carry can be ignored. Be sure the index value is "bound" to less or equal to the # of table entries. regards, p |
| Topic | Author | Date |
| Part 2:To code a jmp table properly | 01/01/70 00:00 | |
| RE: Part 2:To code a jmp table properly | 01/01/70 00:00 | |
| RE: Part 2:To code a jmp table properly | 01/01/70 00:00 | |
| RE: Part 2:To code a jmp table properly | 01/01/70 00:00 | |
| RE: Part 2:To code a jmp table properly | 01/01/70 00:00 | |
| RE: Part 2:To code a jmp table properly | 01/01/70 00:00 | |
| RE: aka - j | 01/01/70 00:00 | |
| RE: aka - j | 01/01/70 00:00 | |
RE: Part 2:To code a jmp table properly | 01/01/70 00:00 |



