I tried to config the 8051 project and found a problem after disassembler the code.
There are some library link in the code such as libsdcc.lib (startup.rel).

After reset the program call a few thing and then jump to 0x03 and then long jump to address 0x62.
which the start of (Main)
I have yet found clear ram or set stack pointer assembly code from startup.rel

By the way , the example code (dht11 sdcc toolchian) from remote repository found the same problem.

I insert hex code as here after.

:03000000020006F5
:03005F0002000399
:0300030002006296
:1000620053A87F1200C21200C1120087120094121C
:10007200009E1200B443A88012007F80FE75080023
:10008200223205083275A65575A70075A40043A84B
:100092002022759A00759900759B002275CB2075F8
:1000A200CAC075CF0175CEF375CD0375CCE743CBCE
:1000B200802275968075890175898143AB0422225D
:1000C20075A0FF75DC0075D20075800075B1FF75F3
:1000D200DD0075D30075880075B9FF75DE0075D433
:1000E2000075900075C1FF75DE0075D5007594002E
:1000F20075980075C9FF75E20075D6007595007593
:10010200A00075D1FF75E30075D70075B00075D9F1
:10011200FF75E40075DA0075C00075E1FF75E50052
:1001220075DB0075920075E90F75EAF075EB3F75A6
:10013200E60175E72075ED0075EE0075EF0075ECD0
:050142000075ACFF2276
:06003500E4787FF6D8FD1F
:100013007900E94400601B7A0090014B780175A0D8
:1000230000E493F2A308B8000205A0D9F4DAF2754C
:02003300A0FF2C
:10003B007800E84400600A790175A000E4F309D860
:10004B00FC7800E84400600C7900900001E4F0A318
:04005B00D8FCD9FAFA
:0D000600758108120147E5826003020003C6
:04014700758200229B
:00000001FF

Here is disassembler picture.

    JiratInt

    What question are you trying to express ? program dosn't work ?

      admin The problem is I found the code clear ram on address 0x35. But the program never call it.

      JiratInt

      I didn't delve too deeply into the compiler's features, so I don't know why.

      But I'm sure the initialization will happen, otherwise the program will definitely have problems. So far I haven't found many complaints on the SDCC forums.

      Here is the MCS51 startup code, along with instructions that may help you.

        admin I have read sdcc manual before.
        You told that you did not delve into compiler,so I think I must find the solution myself.However thank for your kindness reply.

        8 days later

        Hello JiratInt,
        I just came across your problem and maybe I can help you.
        Regarding to the arrow on the right side of your first picture:
        The command at 000Eh is JZ 03h and it is a branching command. It says:
        Jump if Accumulator is Zero - but it does not jump to a direct address as the arrow shows, instead it does a relative jump.
        So if this condition is true it jumps to 0013h, otherwise it just goes on with 0010h and then it would finally jump to 0003h.
        It seems to me that the accumulator always contains zero, because of the foregoing command.
        Best regards,
        Froschi69

        Write a Reply...