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

Why does my program always start from C:0x00AE?

Dear all,

Thank you for your help in advance.

I created a very simple program to test my Monitor-51 which is showed below:

#include "AT89X55.H"

sbit P25 = 0xA5;

void DELAY(int j)
{
 int i;
 for(;j>0;j--)
  {
   for(i=2;i>0;i--)
    {;}
  }
}

main(){
while(1)
    {
    P25 = 0;
    DELAY(1);
    P25 = 1;
    DELAY(1);
    }
}

When I debugged this program by using Monitor-51,the first line is always "C:0x0000 0200AE LJMP c:00AE" in
the Disassembly window,and the other lines are:
...
C:0x00AE    E4       CLR      A
C:0x00AF    F5CB     MOV      RCAP2H(0xCB),A
C:0x00B1    F5CA     MOV      RCAP2L(0xCA),A
C:0x00B3    F5CC     MOV      TL2(0xCC),A
C:0x00B5    F5CD     MOV      TH2(0xCD),A
C:0x00B7    F5C9     MOV      T2MOD(0xC9),A
C:0x00B9    F5C8     MOV      T2CON(0xC8),A
C:0x00BB    20B0FD   JB       RXD(0xB0.0),C:00BB
C:0x00BE    30B0FD   JNB      RXD(0xB0.0),C:00BE
C:0x00C1    D2CA     SETB     TR2(0xC8.2)
C:0x00C3    30B003   JNB      RXD(0xB0.0),C:00C9
C:0x00C6    30CFFA   JNB      TF2(0xC8.7),C:00C3
C:0x00C9    30B0FD   JNB      RXD(0xB0.0),C:00C9
C:0x00CC    30B003   JNB      RXD(0xB0.0),C:00D2
C:0x00CF    30CFFA   JNB      TF2(0xC8.7),C:00CC
C:0x00D2    30B0FD   JNB      RXD(0xB0.0),C:00D2
C:0x00D5    C2CA     CLR      TR2(0xC8.2)
C:0x00D7    20CFD4   JB       TF2(0xC8.7),C:00AE
C:0x00DA    AFCC     MOV      R7,TL2(0xCC)
C:0x00DC    AECD     MOV      R6,TH2(0xCD)
C:0x00DE    EE       MOV      A,R6
C:0x00DF    C3       CLR      C
...
And I failed to change the statement by use of "Inline assembly".Why the assembly try to initial the timer2? I wonder if the MON51.HEX createad by INSTALL.A51 is fit to AT89S52? The MCU is AT89S52. I set the Option for target as follow: Off-chip code memory Start:0x8000, size:0x3fff, Off-chip Xdata memory Start:0xc000, size:0x3fff. When I use simulator to debug this program there is no problem. Can you give me a hand? Thanks.

Parents
  • Why does my program always start from C:0x00AE?

    This question reminds me of a Peter Sellers movie.

    A man asks an innkeeper, "Does your dog bite?" The innkeeper said, "No." The man leans over to pet the dog and the dog nearly eats his hand off. He turns to the innkeeper and says, "I thought you said your dog did not bite." The innkeeper responds, "That is not my dog."

    I guess my smart-aleck answer to "Why does my program always start from C:0x00AE?" is, "That is not your program!"

    Jon

Reply
  • Why does my program always start from C:0x00AE?

    This question reminds me of a Peter Sellers movie.

    A man asks an innkeeper, "Does your dog bite?" The innkeeper said, "No." The man leans over to pet the dog and the dog nearly eats his hand off. He turns to the innkeeper and says, "I thought you said your dog did not bite." The innkeeper responds, "That is not my dog."

    I guess my smart-aleck answer to "Why does my program always start from C:0x00AE?" is, "That is not your program!"

    Jon

Children
No data