[prog] Assembly with C

Jimen Ching jching at flex.com
Thu Jan 2 11:07:06 EST 2003


On Thu, 2 Jan 2003, millward wrote:
>How do you attach a function written in MASM assembly for Linux to a C
>program? Or where could I find this information for myself?

I only know GCC, so here is the link to the GCC manuals.

	http://gcc.gnu.org/onlinedocs/

Pick a version and search for the 'assembler' keyword in the table of
contents page.

>I have read that input and ouput can be made faster by using assembly
>rather than the usual C functions, so I thought I'd try it.  I used to
>program x86 assembly a long time ago.

You mean like inb/outb instructions?  With a sufficently fast CPU, I
would assume the processing would be much faster than the I/O operations.
Thus, the CPU is just idling most of the time.  Unless you're talking
about graphics transformations before sending the rendered data to the
graphics card.  But most graphics cards today use memory mapping.  So
there is no inb/outb.

But people do use assembly to improve performance.  I.e. for inner loops
or specialized versions of memcpy.  The only other use for assembly is to
access hardware such as special purpose registers in the CPU.

--jc
--
Jimen Ching (WH6BRR)      jching at flex.com     wh6brr at uhm.ampr.org





More information about the Programming mailing list