[fpc-pascal] Coroutines and VirtualAlloc

Ryan Joseph ryan at thealchemistguild.com
Wed Apr 19 11:25:53 CEST 2017

> On Apr 19, 2017, at 4:14 PM, Sven Barth via fpc-pascal <fpc-pascal at lists.freepascal.org> wrote:
> Those functions simply store (setjmp) and restore (longjmp) register values (and setjmp also returns the value passed to longjmp if it had been reached by a longjmp). Nothing more, nothing less. So while the stack register while be changed, the contents on the stack will not.

Why doesn’t “i” in my example increment? The value keeps going back to 1 even after I used += 1 so its like the old copy of the stack before the jump got pushed back on top and it started over. I don’t understand how assembly works but I thought it would just start over and the state of the stack in that function would still be the same as before so I could keep adding 1 every pass.

	Ryan Joseph

More information about the fpc-pascal mailing list