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

Back to Subject List

Old thread has been locked -- no new posts accepted in this thread
???
09/30/09 19:54
Read: times


 
#169311 - Understand meaning of EQU and DB
Responding to: ???'s previous message
DB0 EQU P1.0 just tells the assembler that whenever you write DB0 in the source code, you really mean P1.0. You are creating alternative names - this is very common to make the source code easier to read, and to allow you to redefine parts of the code without reading through every line of code.

In your examples the display signal EN is connected to P3.7, signal RS is connected to P3.6 and signal RW is connected to P3.5. By having named constants like this, you can rewire your hardware and just change these declarations to get your program to work with a new pin allocation.

Your assembler is not expected to recognize EN, RS, RW - they are not intended to be magic keywords for the assembler but user-defined constants naming signals you have connected to the processor. So the the assembler will (after performing the replacement EN -> P3.7) recognize assembler instructions referencing the P3.7 bit.

DB means Define Byte. So DB x,y,z will just store three bytes with the value x, y and z in the memory.

DB EQU x, EQU y, EQU z would not make sense, since EQU is a binary operator requiring an argument on each side. I don't know why you think you would need to use the EQU keyword in a DB statement.

List of 23 messages in thread
TopicAuthorDate
LCD Tutorial and assembler help please            01/01/70 00:00      
   Understand meaning of EQU and DB            01/01/70 00:00      
      Wow didn't realize!            01/01/70 00:00      
         Your assembler manual...            01/01/70 00:00      
            ..thanks            01/01/70 00:00      
         Try understanding the LCD requirements, too!            01/01/70 00:00      
            I've played around with LCDs before            01/01/70 00:00      
               You can't avoid the study.            01/01/70 00:00      
         Hmm but also...            01/01/70 00:00      
            Yes, that is what the manual says!            01/01/70 00:00      
   LCD interfacing tutorials            01/01/70 00:00      
      Author affiliation            01/01/70 00:00      
      RE: Seven-Segment LED Display            01/01/70 00:00      
         Single resistor only ok with multiplexing            01/01/70 00:00      
            Multiplexing segments?            01/01/70 00:00      
               No, I don't think so            01/01/70 00:00      
               It was common in the days of LED-display calculators            01/01/70 00:00      
                  Technology moves forward            01/01/70 00:00      
                     Not much thought goes into some of those displays            01/01/70 00:00      
                        HP printers            01/01/70 00:00      
                           Good backlight on HPLJ too            01/01/70 00:00      
                           Yes, I've noticed that ... however ...            01/01/70 00:00      
         RE: Seven Segment Display Tutorial            01/01/70 00:00      

Back to Subject List