Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

gcc, inline assembly - pushad/popad missing?

Any way to avoid having to copy-paste the pushad/popad instruction body into my code?

Because gcc (current flags: -Wall -m32) complains that

__asm__("pushad;");

Error: no such instruction: `pushad'

__asm__("popad;");

Error: no such instruction: `popad'

like image 852
User1291 Avatar asked Sep 12 '25 08:09

User1291


1 Answers

GCC use AT/T assembly syntax, while pushad/popad are Intel convention, try this:

__asm__("pushal;");
__asm__("popal;");
like image 187
fluter Avatar answered Sep 13 '25 23:09

fluter