??? 06/19/07 00:48 Read: times |
#140966 - Some remarks Responding to: ???'s previous message |
Asif Ali:
I would use RL A instead of MOV B,#2 and MUL (shorter faster)b, Remove the MOVC A,A+DPTR Use AJMP instead of SJMP (still 2 byte) Because you jump the the table location, You will never reach the SJMP AGAIN You have to do a CALL A+DPTR The instruction does not exits but you can emulate it. The Code would be: RL A MOV DPTR,#MY_TABLE ACALL PERFORM ; Call Ath entry of jmptable SJMP AGAIN ; We return here PERFORM: JMP @A+DPTR MY_TABLE: SJMP LOC1 ;My table here SJMP LOC2 SJMP LOC3 SJMP LOC4 SJMP LOC5 But remember this program only works correct if the input is 0,1,2,3 or 4 In other case it calls whatever is after the table So Test the input for a correct value Have a nice day Robert |
Topic | Author | Date |
How to branch through table, without CJNE ? | 01/01/70 00:00 | |
You are very close | 01/01/70 00:00 | |
Oh Thanks sir, :-) you are really great, | 01/01/70 00:00 | |
WoW sir it really worked:-) here is full code, | 01/01/70 00:00 | |
Not quite | 01/01/70 00:00 | |
re: Abbreviations | 01/01/70 00:00 | |
Some remarks | 01/01/70 00:00 | |
Some Corrected Remarks :-) | 01/01/70 00:00 | |
The difference | 01/01/70 00:00 | |
other type of table, XOR instead CJNE ;-) | 01/01/70 00:00 | |
Rotate![]() | 01/01/70 00:00 |