Forum > General

Integration of external assembler sources

(1/1)

MathMan:
Hello all,

I am currently working under FPC 2.6.4 and Lazarus 1.4.2 on Ubuntu Linux 15.04.

For my arbitrary precision package I do now support two hardware platforms - Intel Nehalem & Skylake. To cope with this I would like to separate the assembler functions - that is move them from the inline assembler to an external assembler (I chose NASM). I do have some issues that I couldn't track down on the wiki (or elsewhere):

 * how to integrate the assembler sources into the project and build process?
 * how to distribute conditional build Information from Pascal to NASM?
 * some small minor ideas

Anybody around here who could provide some insight on how to best do this?

Kind regards,
MathMan

Thaddy:
The easiest way is to compile the NASM asm files to obj files and link them in with {$LINKLIB <asm_binary_name>}
In your own pascal code you would probably want to {$DEFINE} the processor you want to compile for.
This can not be automated (yet) in any other way.

MathMan:

--- Quote from: Thaddy on October 12, 2015, 12:16:28 pm ---The easiest way is to compile the NASM asm files to obj files and link them in with {$LINKLIB <asm_binary_name>}
In your own pascal code you would probably want to {$DEFINE} the processor you want to compile for.
This can not be automated (yet) in any other way.

--- End quote ---

Ok - I see. Is there at least a chance to integrate the assembler files into the project build process? Meaning that when I compile all assembler files will first be assembled (and by selecting the processor target the required object files will then be linked)?

Thaddy:
You can use make for that. fpmake doesn't support that afaik, so you can write a simple make script. That has always been the case. (fpc users are spoiled brats in that respect.. ;) )

MathMan:

--- Quote from: Thaddy on October 12, 2015, 01:33:18 pm ---You can use make for that. fpmake doesn't support that afaik, so you can write a simple make script. That has always been the case. (fpc users are spoiled brats in that respect.. ;) )

--- End quote ---

Uh huh! I'll work hard not to become another  ;)

Navigation

[0] Message Index

Go to full version