; Dynamic RT Stack Simulation Demo Script ; ; Initiate a process and check the stack: call main 0 3 1 2 3 display ; ; Make one function call and check the stack: call F01 1 42 2 17 3 display ; ; Modify some locals and check the stack: set 1 10 set 2 20 display ; ; Make a bunch more function calls and check the stack: call F02 0 1 5 call F03 2 13 7 0 call F04 0 8 10 20 30 40 50 60 70 80 call F05 3 1 2 3 2 24 8 call F06 1 3 1 4 ; Stack should be of size 8 and hold 7 records: display ; ; This call should result in a full stack: call F07 0 0 display ; ; And this one should cause the stack to double in size again: call F08 1 3 1 5 display ; ; Try modifying another local: set 1 10 display ; ; Terminate some functions: return return return display ; ; This one should cause the stack to size 8 shrink again: return display ; ; Call a few more: call F09 0 0 call F10 3 1 2 3 0 call F11 0 3 1 2 3 ; ; Stack should have 8 records and be full: display ; ; Now we get an access violation: set 4 10 ; ; Stack should be empty and have size 1: display ; ; Nasty; let's try starting a new process: call main 0 5 1 2 3 4 5 call G01 0 0 call G02 0 0 display ; ; Quit: exit