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

Back to Subject List

Old thread has been locked -- no new posts accepted in this thread
???
04/14/07 14:13
Read: times


 
#137256 - i get it now
Responding to: ???'s previous message
ok. I see. But most assemblers do use "$" to represent the location of the current instruction right?
At least ASEM-51 does.

As for newbies, I would suggest

AJMP $
END

as the last two lines of code.

or if you have routines, I suggest you add:

AJMP $

before the start of a routine (whose names normally appear after LCALL and/or ACALL)

For example, this code:

---- your mainline code here
AJMP $

routine1:
---- your routine1 code here
RET

routine2:
---- your routine2 code here
RET

AJMP $
END


is better than this code:

---- your mainline code here

routine1:
---- your routine1 code here
RET

routine2:
---- your routine2 code here
RET

END

Because the second code will run the 1st routine after the mainline ends whether or not the routine has been called. Also because of RET, it will run code at address R6:R7 (or is it R7:R6?) immediately after RET is executed, provided register bank 0 is used (which is the default setting), and SP remains at 07h.



List of 34 messages in thread
TopicAuthorDate
RxD to LCD problems            01/01/70 00:00      
   Serial ISR            01/01/70 00:00      
   work needed.            01/01/70 00:00      
   you need to control flow            01/01/70 00:00      
      confused            01/01/70 00:00      
         this is what I mean            01/01/70 00:00      
            OK            01/01/70 00:00      
               yes            01/01/70 00:00      
            Non-useful Serial ISR            01/01/70 00:00      
               AND it's stuck            01/01/70 00:00      
                  thanks            01/01/70 00:00      
               I was going for optimization.            01/01/70 00:00      
      It's functioning            01/01/70 00:00      
         now stay consistent            01/01/70 00:00      
            Terminating code?            01/01/70 00:00      
               .            01/01/70 00:00      
                  correct terminology            01/01/70 00:00      
                  Missing the point            01/01/70 00:00      
                     i get it now            01/01/70 00:00      
                        Most, but not all            01/01/70 00:00      
                        why on earth            01/01/70 00:00      
                        if it\'s almost correct, it\'s still wrong :-)            01/01/70 00:00      
                           ok            01/01/70 00:00      
                              Not R6 and R7            01/01/70 00:00      
                                 well it happend again            01/01/70 00:00      
                                    Q.E.D.            01/01/70 00:00      
                                       One further comment is needed            01/01/70 00:00      
                              Hey            01/01/70 00:00      
                        Dangerous recommendation            01/01/70 00:00      
                           good point            01/01/70 00:00      
                              they all do            01/01/70 00:00      
                  it 'trust' the same as 'experiment'?            01/01/70 00:00      
   more issues            01/01/70 00:00      
      Joe, please read this            01/01/70 00:00      

Back to Subject List