Main / News / Assembling special cases

Highest priority of the GATE project is portability. We don’t want code (again) that only runs on platform XYZ.

But … for every rule exists an exception:
So let’s talk about native assembler codes for callstack manipulation.

Coroutines are easy to implement, if the OS provides utilities for stack management and user mode scheduling. Windows Fibers and Linux ucontext APIs are the most common examples.

When such APIs are missing (e.g. on BSD), we can only utilize separate threads to simulate coroutines in native C code.

This approach is really inefficient.

CMake allows us to compile and link native assembly code to overcome such plattform limits.
Now we have some few .asm (Windows) or .S files in the GATE codebase to setup callstacks and entry points in case we want to use them.

Using assembly code is optional and will be deactivated by default from the GATE framework build. But in case we want or need it, we can just activate assembler support in CMake and the hand-written code is injected.