Recent

Author Topic: Integration of external assembler sources  (Read 2832 times)

MathMan

  • Sr. Member
  • ****
  • Posts: 325
Integration of external assembler sources
« on: October 12, 2015, 11:52:28 am »
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

  • Hero Member
  • *****
  • Posts: 14381
  • Sensorship about opinions does not belong here.
Re: Integration of external assembler sources
« Reply #1 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.
Object Pascal programmers should get rid of their "component fetish" especially with the non-visuals.

MathMan

  • Sr. Member
  • ****
  • Posts: 325
Re: Integration of external assembler sources
« Reply #2 on: October 12, 2015, 01:14:26 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.

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

  • Hero Member
  • *****
  • Posts: 14381
  • Sensorship about opinions does not belong here.
Re: Integration of external assembler sources
« Reply #3 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.. ;) )
Object Pascal programmers should get rid of their "component fetish" especially with the non-visuals.

MathMan

  • Sr. Member
  • ****
  • Posts: 325
Re: Integration of external assembler sources
« Reply #4 on: October 12, 2015, 02:13:31 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.. ;) )

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

 

TinyPortal © 2005-2018