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

Back to Subject List

Old thread has been locked -- no new posts accepted in this thread
???
04/02/11 16:11
Read: times


 
#181676 - Use code tags
Responding to: ???'s previous message
Life is easier if you make your code readable by humans.
I know that some assemblers are forgiving, but why make life difficult?

START:
LOOP:  SETB P2.0
       JNB 2.0,SUBONE
       SETB P2.1
       JB 2.1,SUBTWO
       SETB 2.2
       JB 2.2,SUBTHREE
       SEB 2.3
       JB 2.3,SUBFOUR
       SJMP LOOP

SUBONE:
       RET
SUBTWO:
       RET
SUBTHREE:
       RET
SUBFOUR:
       RET
       END

 

I am sure that your assembler will assemble correctly. Note that your SUBroutines mst all be in 'relative addressing' range.
If those labels are undefined, you will get the error messages.
Likewise if they are out of range.

If you check your assembler manual, you will probably see that 2.3 is not a valid bit address. P2.3 is valid. As a general rule the 'port' must be on a 0bxxxx000 address for bit addressing to work.

David.

List of 21 messages in thread
TopicAuthorDate
problem with simulator?            01/01/70 00:00      
   First of all            01/01/70 00:00      
      normally?            01/01/70 00:00      
         RE: "normally"            01/01/70 00:00      
   just saw it            01/01/70 00:00      
      Erik            01/01/70 00:00      
         "bible time"            01/01/70 00:00      
   Thanks but....            01/01/70 00:00      
      all the same            01/01/70 00:00      
      Learning requires study            01/01/70 00:00      
         a small correction            01/01/70 00:00      
         Thankyou            01/01/70 00:00      
            the chips listed ....            01/01/70 00:00      
   bit/byte addressing            01/01/70 00:00      
   "unknown label"            01/01/70 00:00      
      Use code tags            01/01/70 00:00      
         relative addressing            01/01/70 00:00      
            the Assembler tells you.            01/01/70 00:00      
            How would I find out if the labels are undefined?            01/01/70 00:00      
         nope            01/01/70 00:00      
         horribly wrong            01/01/70 00:00      

Back to Subject List