Continue to Site

Welcome to EDAboard.com

Welcome to our site! EDAboard.com is an international Electronics Discussion Forum focused on EDA software, circuits, schematics, books, theory, papers, asic, pld, 8051, DSP, Network, RF, Analog Design, PCB, Service Manuals... and a whole lot more! To participate you need to register. Registration is free. Click here to register now.

elevator code simulation problem for 80s52 on keil.

Status
Not open for further replies.

Genetron

Newbie level 5
Joined
Jul 13, 2012
Messages
10
Helped
0
Reputation
0
Reaction score
0
Trophy points
1,281
Activity points
1,353
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::

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:

problem is with the code.. remove org 300h and see. i guess u have moved to data allocation memory.
 

just put the 'end' keyword at the end of the service sub routine. i.e. after 'ret' instruction.
 

Didnt worked.. syntax error in acall delay. !!!

- - - Updated - - -

just put the 'end' keyword at the end of the service sub routine. i.e. after 'ret' instruction.

I think 'end' is at proper place.. although I tried. But didnt worked :(
 

Status
Not open for further replies.

Part and Inventory Search

Welcome to EDABoard.com

Sponsor

Back
Top