TIP: Click on subject to list as thread! ANSI
echo: rberrypi
to: MR. MAN-WAI CHANG
from: MARTIN GREGORIE
date: 2018-03-08 12:37:00
subject: Re: Compile Assembly and

On Thu, 08 Mar 2018 18:18:34 +0800, Mr. Man-wai Chang wrote:

> On 8/3/2018 04:39, Tauno Voipio wrote:
>>
>> Are you sure that the ssembly code module is compatible with the ARM
>> arcitecture and instruction set of the Pi?
>
> I have never worked with ARM architecture, mostly x86. No comment on
> that.

The best suggestion so far would seem to be from druck: write the module
that will contain the assembler as a prototype and an empty C function:

/* Prototype, put in a header file, myfunction.h  */
int myfunction(int, char*);

/* empty function as the only contents of a source file, myfunction.c */
int myFn(int bufflth, char* buff)
{
  return 0;
}

include a recipe for this module in your Makefile, compile it and then,
when you know it all compiles and links OK, either
(a) fill the myfunction() body with inline assembler statements
or
(b) grab the assembler source file that gcc produces from it, insert
your assembler code in that and modify the Makefile recipe accordingly.

I'd go with (a) but YMMV.


--
Martin    | martin at
Gregorie  | gregorie dot org

--- SoupGate-Win32 v1.05
* Origin: Agency HUB, Dunedin - New Zealand | FidoUsenet Gateway (3:770/3)

SOURCE: echomail via QWK@docsplace.org

Email questions or comments to sysop@ipingthereforeiam.com
All parts of this website painstakingly hand-crafted in the U.S.A.!
IPTIA BBS/MUD/Terminal/Game Server List, © 2025 IPTIA Consulting™.