Administrator
|
No, it's not normal.
You want your program to under full control at all time. When your program finishes, you want the CPU to enter an infinite loop so that it sits there looking stupid. What you don't want is for it to wonder off into program ROM to some random place and execute whatever instructions it happens to find there.
Remember, as long as the clock is running (and the CPU isn't in reset), the computer IS executing whatever it finds at whatever address is in the program counter. You want your program to make sure that that is what you want it to be.
The way that this is recommended to be done is for your your Sys.init() to call the Sys.halt() function once it's call to Main.main() returns. Another way to ensure make this happen is for your bootstrap code to include this behavior in the code it adds. Either way works fine, but the easiest way is to do it the recommended way.
|