??? 09/28/04 04:25 Read: times |
#78223 - RE: Does your code work with LCALLs? Responding to: ???'s previous message |
HELLO KAI.
ACALL and LCALL do not work here. and i don t kow why. only (one) ACALL or LCALL work in the loop "Simulated" all examples works ok. writed in an AT89C51 the example 04 fail. this example work well: EXAMPLE - 01 org 0000h loop: clr p2.0 acall delay1 setb p2.0 acall delay1 sjmp loop delay1: mov 30h,#255 mov 31h,#255 time1: djnz 30h,time1 djnz 31h,time1 ret end ;********************************************* EXAMPLE - 02 this example work well: org 0000h loop: clr p2.0 acall delay1 setb p2.0 acall delay2 sjmp loop delay1: mov 30h,#255 mov 31h,#255 time1: djnz 30h,time1 djnz 31h,time1 sjmp commom_return delay2: mov 30h,#255 mov 31h,#255 time2: djnz 30h,time2 djnz 31h,time2 sjmp commom_return commom_return:;only (one)RET for delay1 and delay2 ret end ;********************************************* EXAMPLE - 03 no ACALL or LCALL, only (SJMP). this example work well: org 0000h loop: clr p2.0 sjmp delay1 a1: setb p2.0 sjmp delay2 a2: sjmp loop delay1: mov 30h,#255 mov 31h,#255 time1: djnz 30h,time1 djnz 31h,time1 sjmp a1 delay2: mov 30h,#255 mov 31h,#255 time2: djnz 30h,time2 djnz 31h,time2 sjmp a2 end ;**************************************************** This code no not work. EXAMPLE - 04 org 0000h loop: clr p2.0 acall delay1 setb p2.0 acall delay2 sjmp loop delay1: mov 30h,#255 mov 31h,#255 time1: djnz 30h,time1 djnz 31h,time1 ret delay2: mov 30h,#255 mov 31h,#255 time2: djnz 30h,time2 djnz 31h,time2 ret end ;****************************************** Thank you Afranio.S |