Genetron
Newbie level 5
Hello all,
I made code for elevator program. In which, first elevator is on any floor. If we press switch on port0 the leds connected on port one goes to corresponding led one by one with 1 second delay. Here is code. If I omit "acall delay", then I can debug it , (one by one command). But if run whole, problem in acall delay. Can anyone help me in solving it? :?:
Code::
_________________________________
I made code for elevator program. In which, first elevator is on any floor. If we press switch on port0 the leds connected on port one goes to corresponding led one by one with 1 second delay. Here is code. If I omit "acall delay", then I can debug it , (one by one command). But if run whole, problem in acall delay. Can anyone help me in solving it? :?:
Code::
Code:
org 0000h
abc: mov a,p0
mov r0,a
mov r5,a
jz abc
start: mov p1,#01h
mov r2,p1
incr: mov a,r5
subb a,r2
jnz go
jmp pqr
go: mov a,r2
acall delay
rlc a
mov r2,a
mov p1,r2
jmp incr
pqr: nop
end
org 300h
delay: mov TMOD,#10h
REPEAT:mov r1,#16
here: mov TH1,#1Eh
mov TL1,#0FCh
setb TR1
again: jnb TF1,again
clr tr1
clr tf1
djnz r1,here
ret
_________________________________
Last edited by a moderator: