Creating an obj in fasm

For everything that's not in any way related to PureBasic. General chat etc...
Dare2
Moderator
Moderator
Posts: 3321
Joined: Sat Dec 27, 2003 3:55 am
Location: Great Southern Land

Creating an obj in fasm

Post by Dare2 »

I was using masm to make obj/lib files for my own use, but decided to switch to fasm.

For use in something like this:

Code: Select all

Import "path\to\addTwoLongs.obj"
  plusTwoLongs.l (longA.l ,longB.l)  As "addTwoLongs"
EndImport 

Debug plusTwoLongs(13,14)
and using an approach like this in fasm:

Code: Select all

format MS COFF

section '.text' code readable executable

public addTwoLongs

 addTwoLongs:
   pop ecx
   pop eax
   pop edx
   push ecx
   add eax, edx
   ret
I can get things going, but am unsure if this is the correct way to do it, that is:
  • pop the return address
    pop the params
    push the return
    do the job
    ret.
Is there a "correct" or standard way. Thanks!
@}--`--,-- A rose by any other name ..