??? 04/12/11 22:41 Read: times |
#181835 - Table bytes comparison Responding to: ???'s previous message |
In the 8051 mcu there are different memory areas, each one having their own addressing modes. http://www.8052.com/tutaddr.phtml#External%20Indirect
If both tables are located in code memory you can use the DPTR (16bit) register to get each byte and compare with the other table one-by-one. If a table is located in iRam you can use the mov A, @R0 If a table is located in pData you can use the movx A, @R0 If a table is located in xData you can use the movx A, @DPTR If a table is located in Code memory you can use the movc A, @A+DPTR Some chips have 2 DPTR(s), making easier a task like this comparison. The tables you showed so far have fixed lentgh of 25bytes. Using C language as a method to program the 8051, functions from the standard C library are usefull to have this work(compare) done. |