Administrator
|
Sys.halt() is just an infinite loop. There is no "halt" CPU instruction so there is no "halt" VM command. You can look at the VM code for Sys.halt() in the supplied Sys.vm and determine what it does.
Yes, when Main.main() returns to Sys.init(), you should enter an infinite loop or call Sys.halt(). (I think calling Sys.halt() is conceptually cleaner, but an optimizing compiler would be able to compile while(true) to a single jump instruction.)
--Mark
|