flat assembler
Message board for the users of flat assembler.

Index > Projects and Ideas > FASMLIB 0.8.0 - general purpose library

Goto page 1, 2, 3  Next
Author
Thread Post new topic Reply to topic
vid
Verbosity in development


Joined: 05 Sep 2003
Posts: 7105
Location: Slovakia
vid 23 Jan 2006, 22:21
FASMLIB is multiplatform library for x86 (32 bit) ASM programmers. It is designed to be easy to and powerful (you often have simple and powerful versions of same function). It's purpose is to get programmer rid of annoying routine coding, and to allow to write multiplatform programs easily in assembler. Also it is designed to catch many bugs in code.

There is version for win32 and linux platforms. It has support for FASM, MASM, NASM and YASM. Support for other platforms and assemblers can be added, just contact me.

Current official release is version 0.8.0.

Official Website
download FASMLIB 0.8.0


Last edited by vid on 07 Dec 2007, 10:16; edited 33 times in total
Post 23 Jan 2006, 22:21
View user's profile Send private message Visit poster's website AIM Address MSN Messenger ICQ Number Reply with quote
vid
Verbosity in development


Joined: 05 Sep 2003
Posts: 7105
Location: Slovakia
vid 06 Dec 2007, 20:16
version 0.8.0 is out.

Code:
FASMLIB v0.8.0
 + support for qword conversions
 + support for conversions from signed decimal/hex format
 + documentation in HTML format (single file) added
 + added FASMLIB structures to include files
 - restructured "Usage" part of documentation
 - fixed DLL, added import library and MASM example for it
 - fixed bug in stdstream.uninit in case of error
 ! "stream.peek" behavior slightly changed, to allow faster processing
    
Post 06 Dec 2007, 20:16
View user's profile Send private message Visit poster's website AIM Address MSN Messenger ICQ Number Reply with quote
vid
Verbosity in development


Joined: 05 Sep 2003
Posts: 7105
Location: Slovakia
vid 07 Dec 2007, 03:00
By the way, i just finished conversion from ASCII string to floating point number with great precision (same like FASM has). And it is just as slow as FASM's conversion routine too Wink

We should have floating point conversions in FASMLIB 0.9.0
Post 07 Dec 2007, 03:00
View user's profile Send private message Visit poster's website AIM Address MSN Messenger ICQ Number Reply with quote
edfed



Joined: 20 Feb 2006
Posts: 4341
Location: Now
edfed 07 Dec 2007, 04:23
where is coming from the ascii string?
where do you remember the result of the convertion?

fixed memory in application?
stack?
registers?

these questions are just to follow the same way than you.
possibly, i'll use a fasmlib like to be compatible with your fasmlib.

so, function i don't made can be taken in your lib, and function you don't made can be taken from mine.
Post 07 Dec 2007, 04:23
View user's profile Send private message Visit poster's website Reply with quote
vid
Verbosity in development


Joined: 05 Sep 2003
Posts: 7105
Location: Slovakia
vid 07 Dec 2007, 10:17
edfed: just download FASMLIB and check documentation and examples, it's all there. To explain entire FASMLIB calling standard again would take too much time.
Post 07 Dec 2007, 10:17
View user's profile Send private message Visit poster's website AIM Address MSN Messenger ICQ Number Reply with quote
0.1



Joined: 24 Jul 2007
Posts: 474
Location: India
0.1 07 Dec 2007, 10:33
please don't mind if I can ask!
i think standard C library does this and much more. why should you bother to write
fasmlib?

_________________
Code:
 o__=-
 )
(\
 /\  
    
Post 07 Dec 2007, 10:33
View user's profile Send private message Reply with quote
vid
Verbosity in development


Joined: 05 Sep 2003
Posts: 7105
Location: Slovakia
vid 07 Dec 2007, 10:38
Mostly just for fun Smile

If you want reasoning and blah blah, here: http://en.wikipedia.org/wiki/FASMLIB#Why_not_libc.

LibC is a bit more pain in the ass to use (epecially to use properly) in assembly. And some things are simply fucked up in libc Smile
Post 07 Dec 2007, 10:38
View user's profile Send private message Visit poster's website AIM Address MSN Messenger ICQ Number Reply with quote
0.1



Joined: 24 Jul 2007
Posts: 474
Location: India
0.1 07 Dec 2007, 10:48
plz dont mind again!
wiki wrote:
width of types is not defined. On some implementations type long may have 64bit width, on others it can be 32bit.

is fasmlib supposed to be run on both 32 and 64 bits systems?

_________________
Code:
 o__=-
 )
(\
 /\  
    
Post 07 Dec 2007, 10:48
View user's profile Send private message Reply with quote
vid
Verbosity in development


Joined: 05 Sep 2003
Posts: 7105
Location: Slovakia
vid 07 Dec 2007, 10:55
Quote:
Quote:
width of types is not defined. On some implementations type long may have 64bit width, on others it can be 32bit.

is fasmlib supposed to be run on both 32 and 64 bits systems?

No, FASMLIB is 32bit only. But that has nothing to do with mentioned statement.

In theory, type "long" can still be 64bit on 32bit system too. Some libc implementations can not support any 64bit numbers on 32bit system. Etc.

Libc is usable as long as you use only one it's implementation. Problems start if you want portability. Even still, I think that FASMLIB has much nicer interface to use in assembly, than libc
Post 07 Dec 2007, 10:55
View user's profile Send private message Visit poster's website AIM Address MSN Messenger ICQ Number Reply with quote
kasake36



Joined: 28 Mar 2006
Posts: 68
kasake36 09 Sep 2008, 07:06
Hello vid! Is it planned to implement additional filesystem operations like to open and read directories and setting file properties? I would like to move on to CGI programming with FASM, and FASMLIB seems perfect for that, since i'm actually programming on WINDOWS, while application should run on LINUX too...
Post 09 Sep 2008, 07:06
View user's profile Send private message Reply with quote
vid
Verbosity in development


Joined: 05 Sep 2003
Posts: 7105
Location: Slovakia
vid 09 Sep 2008, 09:04
I *did* plan it while i was working on FASMLIB, but now this project is paused at best (or likely, stopped completely). The most i will maybe do one day would be "completing" version 1.0 (support for floating point numbers and support for directory services), but even that is not sure, and surely it won't happen soon.
Post 09 Sep 2008, 09:04
View user's profile Send private message Visit poster's website AIM Address MSN Messenger ICQ Number Reply with quote
kasake36



Joined: 28 Mar 2006
Posts: 68
kasake36 09 Sep 2008, 14:13
May i ask why you did stop it? Was it because of lack of time or where there simply other libraries with more functionality?
Post 09 Sep 2008, 14:13
View user's profile Send private message Reply with quote
vid
Verbosity in development


Joined: 05 Sep 2003
Posts: 7105
Location: Slovakia
vid 09 Sep 2008, 17:06
Because i slowly moved to other project, "serious" one, one that i am pursuing now. I'd like to finish things i listed in previous post, but i won't have time for that so soon.
Post 09 Sep 2008, 17:06
View user's profile Send private message Visit poster's website AIM Address MSN Messenger ICQ Number Reply with quote
kasake36



Joined: 28 Mar 2006
Posts: 68
kasake36 10 Sep 2008, 06:38
Well, i see the problems with libc listed in your Wikipedia entry. If i really make the step towards CGI programming with ASM, i will try to expand FASMLIB as good as i can. In this case i will contact you of course, if you still like to maintain FASMLIB.
Post 10 Sep 2008, 06:38
View user's profile Send private message Reply with quote
Dominick



Joined: 26 Jul 2011
Posts: 2
Dominick 26 Jul 2011, 22:53
Hi Vid,


I'm having trouble with fasmlib... specifically linking?


I originally was working with alink to get my generated object files made into an executable... I've tried linking with microsoft's linker as well but I get similar errors.

Here's the assembly file I'm working with (hello.asm):

Code:
%include "fasmlib.inc"
global _start
[section .text]
_start:
  ;initialize FASMLIB
 call    fasmlib.init
        jc      error

   ;display string
     push    _hello
      call    stdout.write
        jc      error

   ;uninitialize FASMLIB
       call    fasmlib.uninit
      jc      error

   ;exit with code 0
   push    0
   call    process.exit

;error handler
error:
    ;get error message
  push    eax
 call    err.text

        ;display error message
      push    eax
 push    _err_format
 call    stderr.write.format

     ;uninitialize FASMLIB
       call    fasmlib.shutdown

        ;exit with code 1
   push    1
   call    process.exit

[section .data]
_hello           db "Hell o' World",10,0
_err_format       db 10,"Error: %s",10,0    


And here's the process that I'm going through to get the errors I've gotten:

nasm -fcoff "hello.asm" -o test.obj

alink -oPE -subsys console test.obj fasmlib.obj fasmlib2.obj fasmlib2.lib libcmt.lib -o test.exe

ALINK v1.6 (C) Copyright 1998-9 Anthony A.J. Williams.
All Rights Reserved

Loading file test.obj
Loading file fasmlib.obj
Loading file fasmlib2.obj
Loading file fasmlib2.lib
415 symbols
Loaded first linker member
Loading file libcmt.lib
5933 symbols
Loaded first linker member
matched Externs
matched ComDefs
Unresolved external __imp__GetProcessHeap@0
Unresolved external __imp__HeapAlloc@12
Unresolved external __imp__GetLastError@0
Unresolved external __imp__HeapFree@12
Unresolved external __imp__HeapReAlloc@16
Unresolved external __imp__CreateFileA@28
Unresolved external __imp__CloseHandle@4
Unresolved external __imp__ReadFile@20
Unresolved external __imp__WriteFile@20
Unresolved external __imp__SetFilePointer@16
Unresolved external __imp__ExitProcess@4
Unresolved external __imp__GetStdHandle@4
Unresolved external __imp__GetProcessHeap@0
Unresolved external __imp__HeapAlloc@12
Unresolved external __imp__GetLastError@0
Unresolved external __imp__HeapFree@12
Unresolved external __imp__HeapReAlloc@16
Unresolved external __imp__CreateFileA@28
Unresolved external __imp__CloseHandle@4
Unresolved external __imp__ReadFile@20
Unresolved external __imp__WriteFile@20
Unresolved external __imp__SetFilePointer@16
Unresolved external __imp__ExitProcess@4
Unresolved external __imp__GetStdHandle@4


Any help you could give would surely be appreciated, thanks,

Dominick
Post 26 Jul 2011, 22:53
View user's profile Send private message Reply with quote
vid
Verbosity in development


Joined: 05 Sep 2003
Posts: 7105
Location: Slovakia
vid 26 Jul 2011, 23:12
The errors you get are imports from Kernel32.dll missing. FASMLIB object doesn't build it's own import data. Usually there is "kernel32.lib" which does that for importing KERNEL32.DLL, etc. You should list it in linkers command line arguments, instead of libc (libcmt.lib). Sadly, FASMLIB doesn't get on well with libc (especially on linux), you shouldn't use both at the same time. It was aimed to be alternative, not extra library.

You also shouldn't link all three fasmlib.obj, fasmlib2.obj and fasmlib2.lib, only one of them. Did you the read manual (in doc/ subdir), section "Usage"? The manual gives full example including command line options for MS linker. I never used alink, but it should be analogous to MS link, you just need to get kernel32.lib compatible with it somewhere.
Post 26 Jul 2011, 23:12
View user's profile Send private message Visit poster's website AIM Address MSN Messenger ICQ Number Reply with quote
Dominick



Joined: 26 Jul 2011
Posts: 2
Dominick 27 Jul 2011, 02:04
Sorry, I read the manual... but I've been trying to link with the comments suggested in hello.asm (in examples/nasm/portable/hello). I finally got it to work correctly:
nasm -fwin32 hello.asm -o test.obj

link /subsystem:console test.obj fasmlib.lib kernel32.lib
Microsoft (R) Incremental Linker Version 10.00.30319.01
Copyright (C) Microsoft Corporation. All rights reserved.

fasmlib.lib(init.obj) : warning LNK4078: multiple '.data' sections found with different attributes (C05000C0)

It correctly produces test.exe.


I know that fasmlib is public domain... but I've been wondering about link (which is only available with my install of vc) and kernel32.lib (which are only available with my install of the ddk - I believe) - what would I do in a client environment if I wanted to assemble/link a generated assembly file ... could these files be included with a distribution of my program?


Thanks for your patience and time Vid,

Dominick
Post 27 Jul 2011, 02:04
View user's profile Send private message Reply with quote
vid
Verbosity in development


Joined: 05 Sep 2003
Posts: 7105
Location: Slovakia
vid 27 Jul 2011, 09:31
You are right, I have somehow managed to put libcmt into that one example, no idea what for. Seems it shouldn't be needed.

I am not completely sure about MS link. There is VS Express which is free-as-in-beer, but you have to be agree to its license to use it. Under your circumstances, using different linker than MS link, one that is free-as-in-GNU, seems to be the right solution.
Post 27 Jul 2011, 09:31
View user's profile Send private message Visit poster's website AIM Address MSN Messenger ICQ Number Reply with quote
hihelp



Joined: 15 Dec 2011
Posts: 17
hihelp 03 Jan 2012, 17:28
Hi,vid.
I thought the FASMLIB should contains some network interface.
Thanks for you and your FASMLIB.
Post 03 Jan 2012, 17:28
View user's profile Send private message Reply with quote
leejacky



Joined: 28 May 2012
Posts: 1
leejacky 06 Jun 2012, 08:17
Thanks for the FASMBLIB
Post 06 Jun 2012, 08:17
View user's profile Send private message Visit poster's website Reply with quote
Display posts from previous:
Post new topic Reply to topic

Jump to:  
Goto page 1, 2, 3  Next

< Last Thread | Next Thread >
Forum Rules:
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
You cannot attach files in this forum
You can download files in this forum


Copyright © 1999-2024, Tomasz Grysztar. Also on GitHub, YouTube.

Website powered by rwasa.