December 4, 2016

GCC inline assembly - an introduction

This stuff is a pain. It has a weird syntax and lots of tricky details. But it is rewarding when mastered by allowing you to do lots of amazing things without actually writing assembly language source files. And the resulting inline code is much more efficient and elegant. Almost anyone working on operating systems code will be interested in this topic. It is possible to avoid it entirely by coding C callable routines in assembly language, but using inline assembly avoids call overhead, making this more efficient. In addition, using inline assembly can make code more readable by keeping all the details in one place; however these inline things tend to get gathered up into include files, negating this virtue.
Feedback? Questions? Drop me a line!

Tom's Computer Info / tom@mmto.org