Email: Password: Remember Me | Create Account (Free)

Back to Subject List

Old thread has been locked -- no new posts accepted in this thread
???
12/28/01 01:07
Read: times


 
#18142 - Part 2:To code a jmp table properly
;I took the code that was presented and produced a JMP Table (see below).
;I found if value == "3 " I would not end up at line 1.
;
;The values 2,4,8 mapped to case0, case1, case2.
;I then used anther jmp to map to a case1, case2 and case3.
;(where my code besides).. "Common" replicates the break function in "c".
;
;This seem like a very convoluted method of creating a table.
;So I'm assuming I got it wrong. How can I improve the situation?
;I hate to go back and use a "cjne" topology.

Thank Spencer
;
SUB:

mov a,#value ;input value
clr C

mov dptr,#table
rlc a
jmp @A+dptr

table:
ajmp case0
ajmp case0;

ajmp case1 ;
ajmp case1;

ajmp case2
ajmp case2;

case0:
nop ;code
nop
ajmp common

case1:
nop ;code
nop
ajmp common

case2:
nop ;code
nop
ajmp common

Common:
;do something
ret


List of 9 messages in thread
TopicAuthorDate
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      

Back to Subject List