Pass your options to linker [link to external .obj / .lib]

Share your advanced PureBasic knowledge/code with the community.
traumatic
PureBasic Expert
PureBasic Expert
Posts: 1661
Joined: Sun Apr 27, 2003 4:41 pm
Location: Germany
Contact:

Post by traumatic »

Good programmers don't comment their code. It was hard to write, should be hard to read.
va!n
Addict
Addict
Posts: 1104
Joined: Wed Apr 20, 2005 12:48 pm

Post by va!n »

@FloHimself:
Thanks for sharing this great tip/trick ;)

@traumatic:
thanks for sharing! very nice work! respect! :)

@all people:
first i had some problems to get the code work but after some time i managed to get it work... so i have create a small example package including most required files for for the V2M replayer... (due fact of copyright and licence issue, i dont added any V2M related stuff to the package... you have to download it seperate!)

1. download the archive
2. copy the modded FASM to your PureBasic/Compilers directroy
3. copy the contest of Example/ from archive to C:\LinkStuff\
4. Download the libv2 package at: http://1337haxorz.de/products.html
5. Unpack the LibV2M package and copy "libv2.lib" to your C:\LinkStuff\ folder!
6. Load the Example file and try to comile... should work...!?

here you can download the package:
www.superfilm.tv/LinkStuff.zip
va!n aka Thorsten

Intel i7-980X Extreme Edition, 12 GB DDR3, Radeon 5870 2GB, Windows7 x64,
FloHimself
Enthusiast
Enthusiast
Posts: 229
Joined: Wed May 14, 2003 3:38 pm
Location: Lüneburg - Germany

Post by FloHimself »

(CallFunctionFast() adds 1.5kb! )
you can use the invoke macro instead PUSHing arguments to stack and
using CALL. just copy the PROC32.INC include file from fasm
distribution to the purebasic compilers directory.

then you can replace:

Code: Select all

!PUSH dword [v_hwnd] 
!PUSH dword [v_tuneadr] 
!CALL [v_ssInit] 
with something like this:

Code: Select all

!include 'PROC32.INC'

RequesterTitle$ = "FASM Macro Test"
RequesterText$ = "I was invoked."

Procedure MyMessageRequester(Title$, Text$)
  ProcedureReturn MessageRequester(Title$, Text$)
EndProcedure

*MyReq = @MyMessageRequester()

!invoke p_MyReq, [v_RequesterTitle$], [v_RequesterText$]
My favorite numbers: 09 F9 11 02 9D 74 E3 5B D8 41 56 C5 63 56 88 C0
okasvi
Enthusiast
Enthusiast
Posts: 150
Joined: Wed Apr 27, 2005 9:41 pm
Location: Finland

Post by okasvi »

again something useful :)
User avatar
NoahPhense
Addict
Addict
Posts: 1999
Joined: Thu Oct 16, 2003 8:30 pm
Location: North Florida

Post by NoahPhense »

This just reminds me how little I know about programming.. ;)

- np
User avatar
Psychophanta
Always Here
Always Here
Posts: 5153
Joined: Wed Jun 11, 2003 9:33 pm
Location: Anare
Contact:

Post by Psychophanta »

Hi FloHimself, great to know it.
And great that PB allows FASM directly :D
If we include 'PROC32.INC', the final executable will get bigger size than using PUSHes and CALL ? or not?
http://www.zeitgeistmovie.com

while (world==business) world+=mafia;
FloHimself
Enthusiast
Enthusiast
Posts: 229
Joined: Wed May 14, 2003 3:38 pm
Location: Lüneburg - Germany

Post by FloHimself »

Psychophanta wrote:If we include 'PROC32.INC', the final executable will get bigger size than using PUSHes and CALL ? or not?
the .exe won't get bigger in size. fasm's macro processor is replaceing
the "macro commands" with the "content of the macro".
so fasm will replace any:

Code: Select all

!invoke v_ssInit, [v_tuneadr], [v_hwnd]
with (not literally):

Code: Select all

!PUSH dword [v_hwnd] 
!PUSH dword [v_tuneadr] 
!CALL [v_ssInit] 
My favorite numbers: 09 F9 11 02 9D 74 E3 5B D8 41 56 C5 63 56 88 C0
Post Reply