May I suggest that you simply write the routine in C or C++? An optimizing compiler is going to write much better code than you would.
IMHO, assembly-language code today should be the stuff of a very occasional(!) asm{} block within a file of "C" source-code. About the only place where you see outright ".a" files in, say, the Linux source-tree /arch directory, is in the "trampoline" code. Almost everything else consists of "C" source-code which "sets up for" a particular architecture-specific assembly instruction.
Hand-crafting "ordinary" instruction sequences is frankly a waste of time, IMHO. You can write "C" code that contains no library references; that is exactly equivalent to assembly but much faster and easier to write. (The original Unix kernel was done that way, for instance.)
Last edited by sundialsvcs; 07-22-2016 at 11:11 AM.
|