??? 08/24/07 06:14 Read: times |
#143570 - Wrong tags! Responding to: ???'s previous message |
You need to use the 'pre' tags for code - not 'quote'
See: http://www.8052.com/faqs.phtml?FAQ=120199 Like this: REF_KA_H: DB '0D','86','04','0C3','9C','82','6F','61' DB '56','4E','47','41','3C','37','34','30' DB '2D','2B','29','27' REF_KA_L: DB '0D','86','04','0C3','9C','82','6F','61' DB '56','4E','47','41','3C','37','34','30' DB '2D','2B','29','27' Henry Aliwarga said:
is there something wrong with that??? You haven't given any indication of what you're trying to achieve by it - not even any comments in your code - so it's impossible to say whether this will do it or not! It looks like you're trying to look-up a 16-bit value using a table of high bytes and a table of low bytes? it (sic) is possible with this program: Again, without knowing what "it" it, it's impossible to say whether the program does "it" or not! mov a,sbuf mov dptr,#ref_ka_h movc a,@a+dptr mov ka_h,a mov a,sbuf mov dptr,#ref_ka_h movc a,@a+dptr mov ki_h,a I think it would be better to read SBUF once and save it - otherwise there's a risk that it may contain a different value on the second read! Also, could you not just use a single table where adjacent entries are high and low bytes; eg, REF_KA: DB <hi-0>, <lo-0> ; 16 bits for value 0 <hi-1>, <lo-1> ; 16 bits for value 1 <hi-2>, <lo-2> ; 16 bits for value 2 <>etc Then you load DPTR once to get the high byte, and simply increment it to get the low byte. Try it, and see if it is any quicker and/or more compact... |
Topic | Author | Date |
look up tabe | 01/01/70 00:00 | |
Structure ok, program doesn't make sense | 01/01/70 00:00 | |
Wrong tags! | 01/01/70 00:00 | |
look up tabel | 01/01/70 00:00 | |
Table | 01/01/70 00:00 | |
get 8 bit from look up table.. | 01/01/70 00:00 | |
Check you assembler syntax! | 01/01/70 00:00 | |
I know... | 01/01/70 00:00 | |
RTFM! | 01/01/70 00:00 | |
Characters - surely not?! | 01/01/70 00:00 | |
Thanks guys....![]() | 01/01/70 00:00 |