Need own Procedures using InlineAssembler

Just starting out? Need help? Post your questions and find answers here.
BackupUser
PureBasic Guru
PureBasic Guru
Posts: 16777133
Joined: Tue Apr 22, 2003 7:42 pm

Post by BackupUser »

Restored from previous forum. Originally posted by MrVainSCL.


[== Need own Procedures using InlineAssembler ==]
-------------------------------------------------
Hi everybody... I want hold the exe of my game project as small as possible and so i have still some questions... Can someone show/give me a working replacement for the commands "Random(#max)" and "Str()" in a procedure using pure x86 inline assembler? :wink: Its only to optimize my executeable a bit and to learn a bit of how to use inline asm
in a procedure for those commands... Many thanks in advance... Hope someone can give me a working example. It would be really great :wink:


PIII450, 256MB Ram, 6GB HD, RivaTNT, DirectX8.1, SB AWE64, Win98SE + Updates...

greetz
MrVainSCL! aka Thorsten
BackupUser
PureBasic Guru
PureBasic Guru
Posts: 16777133
Joined: Tue Apr 22, 2003 7:42 pm

Post by BackupUser »

Restored from previous forum. Originally posted by Franco.
I want hold the exe of my game project as small as possible ... replacement for the commands "Random(#max)" and "Str()" in a procedure using pure x86 inline assembler?
Its only to optimize my executeable a bit ...
Well if you want to minimize your exe size to the max, then you have to be aware to not use the following commands in your app:

Asc, Chr, FindString, Hex, LCase, Left, Len, Mid, Right, Str, StripLead, StripTrail, UCase, Val from the string library.

And

Blue, Delay, GetFilePart, GetPathPart, Green, PeekBWL, PeekS, PokeBWL, PokeS, ProgramParameter, Random, Red, RunProgram from the misc library.

Otherwise you don't save space!

BTW: If more users of PureB have this issue (save much space as possible) maybe it is appropriate to have for every command his own lib.
But I don't know if it's possible, and this would increase the number of files in the library directory a lot.


Have a nice day...
Franco
BackupUser
PureBasic Guru
PureBasic Guru
Posts: 16777133
Joined: Tue Apr 22, 2003 7:42 pm

Post by BackupUser »

Restored from previous forum. Originally posted by fred.
BTW: If more users of PureB have this issue (save much space as possible) maybe it is appropriate to have for every command his own lib.
But I don't know if it's possible, and this would increase the number of files in the library directory a lot.
And it would done the compile time takes forever.. Not doable for now (But I'm working on a trick to do it in the current state (include only used commands, as on the Amiga version)).

Fred - AlphaSND
BackupUser
PureBasic Guru
PureBasic Guru
Posts: 16777133
Joined: Tue Apr 22, 2003 7:42 pm

Post by BackupUser »

Restored from previous forum. Originally posted by MrVainSCL.

Hi Franco!
Yes, i know... At the moment i use "Random()" of MiscLib and "Str()" of the StingLib in my program too. At the moment i have optimized my program as best as possible i hope! Surely there are some points you can optimize by using pure API commands and replace some of the original PB commands... But at the moment i dont have really the knowledge to replace all the stuff by using only API stuff... Btw. i replaced "Delay()" by the API "Sleep_()" and i use "MessageBox_()" - Anyway many thanks for your support! :wink:

Hi Fred
That listen very great! But please spent all your time in fixing all bugs in PB before trying a new experience to add only real needed stuff to the executeable! :wink: Good luck man...

PIII450, 256MB Ram, 6GB HD, RivaTNT, DirectX8.1, SB AWE64, Win98SE + Updates...

greetz
MrVainSCL! aka Thorsten
BackupUser
PureBasic Guru
PureBasic Guru
Posts: 16777133
Joined: Tue Apr 22, 2003 7:42 pm

Post by BackupUser »

Restored from previous forum. Originally posted by tranquil.

Nice, nice Mr.Vain :)

I have more then 512 MB System Ram, more then 100 GB Harddisc space and you are coding 32k Games. :))))))

See you this weekend!

Mike

Tranquilizer/ Secretly!
Registred PureBasic User
BackupUser
PureBasic Guru
PureBasic Guru
Posts: 16777133
Joined: Tue Apr 22, 2003 7:42 pm

Post by BackupUser »

Restored from previous forum. Originally posted by Franco.
Surely there are some points you can optimize by using pure API commands and replace some of the original PB commands...
Hi MrVain,
don't know if any other OS than Windows are an issue for you, but keep in mind, the more WinAPI calls you have the more rework you will have by porting your app to Linux or Amiga.


Have a nice day...
Franco
BackupUser
PureBasic Guru
PureBasic Guru
Posts: 16777133
Joined: Tue Apr 22, 2003 7:42 pm

Post by BackupUser »

Restored from previous forum. Originally posted by MrVainSCL.

Hi Tranquil!
Yes, yes... 32k games *g* (hope i will finish the game until the eastern competition and hopefully it will work without bugs :wink:

Hi Franco
First Windows will be my high priority SDK station... The game i am coding at the moment, have been released by me for Amiga as 32k game too - some years ago :wink: You are right, maybe i will port the game later to Linux too!? I know yet more inline assembler or API i will use, that it isnt easy to part the source to another OS... We will see :wink: Hopefully Fred get mange it to include only the real needed stuff to the exe like one Amiga... :wink:

PIII450, 256MB Ram, 6GB HD, RivaTNT, DirectX8.1, SB AWE64, Win98SE + Updates...

greetz
MrVainSCL! aka Thorsten
BackupUser
PureBasic Guru
PureBasic Guru
Posts: 16777133
Joined: Tue Apr 22, 2003 7:42 pm

Post by BackupUser »

Restored from previous forum. Originally posted by Rings.
have more then 512 MB System Ram, more then 100 GB Harddisc space and you are coding 32k Games. :))))))
compile with delphi,kylix or VB (And VB.NET too) and you see those
32k (*10) Games


Siggi
BackupUser
PureBasic Guru
PureBasic Guru
Posts: 16777133
Joined: Tue Apr 22, 2003 7:42 pm

Post by BackupUser »

Restored from previous forum. Originally posted by tranquil.

Yeah, Delphi roxx. It produces heighly optimized code!! *ironic* :)

Tranquilizer/ Secretly!
Registred PureBasic User
BackupUser
PureBasic Guru
PureBasic Guru
Posts: 16777133
Joined: Tue Apr 22, 2003 7:42 pm

Post by BackupUser »

Restored from previous forum. Originally posted by MrVainSCL.

Hi Tranquil:
Surely compiled stuff with VB or Delphi will be much bigger (VB = 1MB *.dll *lol*) - But please remember some of the cool programs by our south africa coder who using Delhi... His programs are in most case very fast and i saw many cool and fast delphi/delhi3D stuff... I am happy that no other coding language can beat PB2.80 (compiled filesize results) :wink: PureBaisc ist just only cool!


PIII450, 256MB Ram, 6GB HD, RivaTNT, DirectX8.1, SB AWE64, Win98SE + Updates...

greetz
MrVainSCL! aka Thorsten
Post Reply