??? 03/16/07 15:20 Modified: 03/16/07 15:40 Read: times |
#135116 - nope - and compiler dependent Responding to: ???'s previous message |
compiler adds a RET instruction. In this SPECIAL case (stack quite clean) RET will produce a software reset (jump to 0x0000).
it will NOT in any '51 case I know of. For Keil, I do not know if main is called or jumped to from ljmp ?C_START at the end of startup.a51 which is jumped to, not called, so, if main is called from whatever that is, it will return there, not to 0. For some other compiler it might be different; however, I know of no compiler that does not execute some assembler code before getting to whatever you have coded. Since a ret at the end of main makes no sense, I would not even bet on all '51 compilers adding it. Erik |
Topic | Author | Date |
Help with the delay program | 01/01/70 00:00 | |
What does it do? | 01/01/70 00:00 | |
Hints. | 01/01/70 00:00 | |
Check with debugger | 01/01/70 00:00 | |
could this be it ? | 01/01/70 00:00 | |
Difficult to see | 01/01/70 00:00 | |
that depends | 01/01/70 00:00 | |
RET in main | 01/01/70 00:00 | |
nope - and compiler dependent | 01/01/70 00:00 | |
RET in functions | 01/01/70 00:00 | |
how do you know that ? | 01/01/70 00:00 | |
Because of Startup | 01/01/70 00:00 | |
ah | 01/01/70 00:00 | |
some contra | 01/01/70 00:00 | |
in other words - and who cares![]() | 01/01/70 00:00 |