User Libraries

Just starting out? Need help? Post your questions and find answers here.
Thomas
Enthusiast
Enthusiast
Posts: 112
Joined: Sat Apr 26, 2003 8:45 pm

User Libraries

Post by Thomas »

How do I create my own commands (user lib) in assembler? I tried to understand the readme.txt in the Library SDK directory but failed.

A simple example with a step by step description would be helpful.

Is there a tutorial for that somewhere?
wcardoso
User
User
Posts: 80
Joined: Fri Apr 25, 2003 5:06 pm
Location: Uruguay

Post by wcardoso »

Why don't use the El_Choni's utility "TailBite" ?. With it you can write libraries in PureBasic code ! :D
with love from Uruguay
Thomas
Enthusiast
Enthusiast
Posts: 112
Joined: Sat Apr 26, 2003 8:45 pm

Post by Thomas »

But I want to use assembler. :P
Moonshine
Enthusiast
Enthusiast
Posts: 263
Joined: Tue May 25, 2004 12:13 am
Location: UK

Post by Moonshine »

Purebasic compiles to ASM, which is how Tailbite makes the libs. So essentially youre cutting out the middle man using PB, and you can still hand optimize the PB code with inline ASM.
Mark my words, when you least expect it, your uppance will come...
jack
Addict
Addict
Posts: 1358
Joined: Fri Apr 25, 2003 11:10 pm

Post by jack »

there are some libs written in asm with sourcecode that you can download
from http://www.purearea.net/ in the libs section.
get SpriteEx its a recent lib written in Fasm, all source included,
also get MathExtras this lib is written in nasm.
by the way, libs written in nasm work just fine with all windows versions of PB.
you will probably need to change the bat file used to compile this libs
to reflect the paths in your system, also you may need to install nasm.
give this libs a try, and if you run into problems let me know and i will
try to help. :)
User avatar
Paul
PureBasic Expert
PureBasic Expert
Posts: 1282
Joined: Fri Apr 25, 2003 4:34 pm
Location: Canada
Contact:

Post by Paul »

Moonshine wrote:Purebasic compiles to ASM, which is how Tailbite makes the libs. So essentially youre cutting out the middle man using PB, and you can still hand optimize the PB code with inline ASM.
TailBite/PB does not produce the optimized ASM code you would get by doing it by hand. Mr.Skunk wrote a tutorial quite a long time ago on writting ASM libs for PB which might help...
http://perso.wanadoo.fr/mr.skunk/
Thomas
Enthusiast
Enthusiast
Posts: 112
Joined: Sat Apr 26, 2003 8:45 pm

Post by Thomas »

With this assembler file

Code: Select all

section '.text' code readable executable

CMP eax,0 
JNS ende
NEG eax
ende:
RET
and this descriptor file

Code: Select all

ASM
0
OBJ
0
Test
AbsI, Long
Long
I get this error message

Line 7: AbsI: no debugger routine
Why do you need a debugger routine? The same reason you need a help directory even if you don't need a help directory (named it 'Test' here)?

The documentation for this is far from being user friendly.

Why can't PB compile into .obj files and create user libs right from the PB editor? Should not be too difficult to achieve... :?
Post Reply