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

Back to Subject List

Old thread has been locked -- no new posts accepted in this thread
???
03/25/03 05:46
Read: times


 
#42188 - RE: N Byte look up table
Responding to: ???'s previous message
You have to code it up as some arithmetic.

The code to be implemented requires that you know your index, size of each table element and the base address of the look up table. To get a pointer to an element in the table you compute:

item_ptr = base_addr + (index * item_size)

Then having the item pointer you can put it in DPTR
as a 16 bit value and use the instructions:

MOV A,#0
MOVC A,@A+DPTR ...... to get 1st byte of item

MOV A,#1
MOVC A,@A+DPTR ...... to get 2nd byte of item

MOV A,#2
MOVC A,@A+DPTR ...... to get 3rd byte of item

Michael Karas


List of 12 messages in thread
TopicAuthorDate
floating/3 byte number-lookup table            01/01/70 00:00      
   RE: floating/3 byte number-lookup table            01/01/70 00:00      
      RE: floating/3 byte number-lookup table            01/01/70 00:00      
         RE: floating/3 byte number-lookup table            01/01/70 00:00      
            RE: floating/3 byte number-lookup table            01/01/70 00:00      
   N Byte look up table            01/01/70 00:00      
      RE: N Byte look up table            01/01/70 00:00      
         RE: N Byte look up table            01/01/70 00:00      
         RE: N Byte look up table            01/01/70 00:00      
            RE: N Byte look up table            01/01/70 00:00      
               RE: N Byte look up table            01/01/70 00:00      
   RE: floating/3 byte number-lookup table            01/01/70 00:00      

Back to Subject List