This discussion has been locked.
You can no longer post new replies to this discussion. If you have a question you can start a new discussion

the call to delay subroutine results infinite loop

I'm using keil uvision 4 and learning programming for AT89s52 , I'm using 12MHZ frequency.

I had written a subroutine for a delay of 10 micro sec which is in another file called DELAY.ASM and made a call from DELAYCALL.ASM to it, but the call results in an infinite loop.

I just dont have a clue why this behaviour, please help?clarify this phenomenon

I tried simulation,found that statement

END

is never reached

ACALL DELAY10MICROSEC

calls itself again and again ,that happens ,and i can find that.but the code was not intended to do that

DELAYCALL.ASM

    $INCLUDE(DELAY.ASM)

    CSEG AT 0

    ACALL DELAY10MICROSEC

    END

DELAY.ASM

    DELAYS_A SEGMENT CODE

    RSEG DELAYS_A

    DELAY10MICROSEC:

    NOP

    NOP

    NOP

    NOP

    NOP

    NOP

    NOP

    NOP

    RET