Hi, I used to work with the AVcase compiler, and it had the exit(0) command to reset the microcontroller. That command doesn't work in Keil. Is there another command in Keil that resets the 8051. Best regards, Eduardo Kluas Barg.
http://www.keil.com/support/docs/307.htm
One of the best ways to implement a software invoked reset function is to make use of a watchdog circuit and to deliberately let it time out. Jumping to address 0x0000 is all very well, but it does not do the same job as a real reset. However, you can partially rectify this by adding startup code that sets registers etc. to a known initial state. The code given in the document given by the link in the previous posting deals with the case where there is one level of interrupts active.
reset: POP ACC ; pop return address POP ACC MOV A,#low(rsx) PUSH Acc MOV A,#high(rsx) PUSH Acc RETI rsx: CLR A ; push 0 as new PUSH ACC ; return address to stack PUSH ACC RETI ; execute return of interrupt
You could try my simple C function that will reset an 8051. Get it at: http://www.embeddedfw.com