Any way to avoid having to copy-paste the pushad/popad instruction body into my code?
pushad
popad
Because gcc (current flags: -Wall -m32)
-Wall -m32
GCC use AT/T assembly syntax, while pushad/popad are Intel convention, try this:
pushad/popad
__asm__("pushal;"); __asm__("popal;");