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

Back to Subject List

Old thread has been locked -- no new posts accepted in this thread
???
05/26/07 19:22
Modified:
  05/26/07 20:03

Read: times


 
#139878 - need...
Responding to: ???'s previous message
Well, Steve, you native english speakers might give a word a shade of meaning we did not meant.

If you mean NEED=NECESSITY, well, that would be rare. Almost everywhere where a @a+pc can be used, @a+dptr can be used, too - (and it does not held the same the other way). But there are numerous cases, where it is MORE APPROPRIATE to use the former than the latter. The dptr is a precious thing in the '51, being useful for many things, so it is handy to do things the way which spares it.

As an example, the classical "print number as hex" is best implemented as a lookup table with the ASCII version of the digits, so you take one nibble at a time and pick the appropriate character from the table. The table can be near enough so that it can be easily reached via @a+pc; and often the "print" routine picks numbers from XRAM for which the dptr is needed.

As I said above, the case where it is a NECESSITY to use @a+pc is rare - but it might happen. In one product I used AT89C2051, but it evolved so that I simply run out of each resource - yet a redesign would not be viable financially (there were several hundred of boards on stock and more several hundred in the field). The code memory could be expanded by migrating to AT89C4051, but the IRAM is hopelessly limited to 128 bytes. I ended up with calculating the necessary stack space, and 1 (ONE) spare RAM byte (plus 2 or 3 spare bits in the bit addressable area, and if I recall it right, I did not use the bits in PSW... :-) - there, there was simply no space to store dptr...

JW


PS. Have you seen the weekend quiz? Solve it - and there is a nice example of such, ehm, need... :-)

List of 24 messages in thread
TopicAuthorDate
How to store data in 8051/DB command            01/01/70 00:00      
   More Detail            01/01/70 00:00      
      Data            01/01/70 00:00      
         DB            01/01/70 00:00      
            1k in db            01/01/70 00:00      
               depends            01/01/70 00:00      
                  starting to understand            01/01/70 00:00      
                     Yes            01/01/70 00:00      
                        better?            01/01/70 00:00      
                           Example ?            01/01/70 00:00      
                              need...            01/01/70 00:00      
                                 Thats it            01/01/70 00:00      
   some answers...            01/01/70 00:00      
      I got MOVC!            01/01/70 00:00      
         The datasheet is the cuestion            01/01/70 00:00      
         store the A contents away...            01/01/70 00:00      
   cant debug a problem...            01/01/70 00:00      
      First step            01/01/70 00:00      
         a skywriter...            01/01/70 00:00      
            well, if you copy crap,, you get crap            01/01/70 00:00      
      I always thought.....            01/01/70 00:00      
   Cant debug, explained + Code            01/01/70 00:00      
   I THINK i found the problem            01/01/70 00:00      
      Long lines            01/01/70 00:00      

Back to Subject List