Host Engineering Forum
General Category => Do-more CPUs and Do-more Designer Software => Topic started by: cyounger on October 09, 2013, 12:42:28 PM
-
Got a quick question guys what happens if I am running a stage program from a prgm called auto and it exits due to a fault and exits the program in the middle of say stage 5. When the prgm. is called to run again will it start with stage 0 (ISG 0 ) or will the pgram start in stage 5 where it left off.
Thanks
-
It will go to SG0.
You will have to monitor which stage(s) were active when you EXIT the Code block, and then use SGSET (or JMP) to re-activate them.
-
ok thanks I was just making sure that the stage would go back to zero.
-
If you ever want the alternative behavior (i.e. start where you left off), look at possibly using the SUSPEND instruction from the "supervisory" program (e.g. $Main would SUSPEND program Auto), instead of EXITing from within 2nd program and re-RUNning from the "supervisory" program which would restart Auto.
We originally wrote SUSPEND as a debugging feature, but it could be utilized for this alternative behavior. (Note that Time does not accumulate within SUSPENDed code-blocks - so TMRs ALSO "suspend". Yes, technically, "time stands still" ;D)
-
Experience slips away. (http://www.youtube.com/watch?v=UTFHwTKWawU) ::) ::) ::)
-
Thanks again the suspend looks interesting I might try it on a future project
Chris