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

Back to Subject List

Old thread has been locked -- no new posts accepted in this thread
???
09/23/04 04:44
Read: times


 
#77976 - Maybe this will work....
Responding to: ???'s previous message
I have modified the code below ( already suggested by Russell )and this should work. You can also think about the following :
> Name the internal ram locations instead of calling them 30h, 31h etc
> Terminate your code with and END directive.
> Make your intentions or rather the program's intentions very clear as comments in the begining.Maybe this is too simple to comment - but then you have to start with good habits some day. Why not now ?
> Initialize all variables at the right place.

OK out of the above, the MCU is just not bothered about the first three points - but it will help us humans in a big way ;-)

; EXAMPLE - 01
led equ p2.0


org 0000h
ljmp 0050h
org 0050h


start:
clr led
acall Delay1
setb led
acall Delay2
sjmp start

Delay1:
mov 30h, #0ffh
mov 31h, #0ffh
time1:
djnz 30h,time1
time2:
djnz 31h,time2
ret

Delay2:
mov 30h, #0ffh
mov 31h, #0ffh
mov 32h, #0ffh
time3:
djnz 30h,time3
time4:
djnz 31h,time4
time5:
djnz 32h,time5
ret

end


Raghu


List of 30 messages in thread
TopicAuthorDate
why my ACALL do not work??            01/01/70 00:00      
   RE: why my ACALL do not work??            01/01/70 00:00      
      RE: why my ACALL do not work??            01/01/70 00:00      
      RE: why my ACALL do not work??            01/01/70 00:00      
         RE: why my ACALL do not work??            01/01/70 00:00      
   Maybe this will work....            01/01/70 00:00      
      RE: now my ACALL is working.why?            01/01/70 00:00      
         It works fine            01/01/70 00:00      
            RE: It works fine            01/01/70 00:00      
         RE: now my ACALL is working.why?            01/01/70 00:00      
            RE: now my ACALL is working.why?            01/01/70 00:00      
               RE: now my ACALL is working.why?            01/01/70 00:00      
               RE: now my ACALL is working.why?            01/01/70 00:00      
                  RE: now my ACALL is working.why?            01/01/70 00:00      
                     RE: now my ACALL is working.why?            01/01/70 00:00      
                  RE: now my ACALL is working.why?            01/01/70 00:00      
                     RE: now my ACALL is working.why?            01/01/70 00:00      
                        RE: now my ACALL is working.why?            01/01/70 00:00      
                           RE: now my ACALL is working.why?            01/01/70 00:00      
                     RE: now my ACALL is working.why?            01/01/70 00:00      
               RE: now my ACALL is working.why?            01/01/70 00:00      
            RE: now my ACALL is working.why?            01/01/70 00:00      
   RE: why my ACALL do not work??            01/01/70 00:00      
      RE: why my ACALL do not work??            01/01/70 00:00      
   RE: why my ACALL do not work??            01/01/70 00:00      
   RE: why my ACALL do not work??            01/01/70 00:00      
   Paging Mr Afranio...            01/01/70 00:00      
      RE: Paging Mr Afranio...            01/01/70 00:00      
         Does your code work with LCALLs?            01/01/70 00:00      
            RE: Does your code work with LCALLs?            01/01/70 00:00      

Back to Subject List