Page 1 of 2

What is the difference between nasm and fasm?

Posted: Sat Oct 15, 2016 9:04 pm
by zutokaza
I have lots of experience in high level programming languages like C, C++, Lua, Java, etc. ASM is very new to me and I kinda consider asm programmers to be the gods of the programming world!

I would like to know the difference between nasm and fasm because I want to program with fasm on Kolibri OS, but there are a lot of books on NASM. Like this one on Tutorial point.

Also, off topic, but can 16bit and 32bit registers be mixed?

Re: What is the difference between nasm and fasm?

Posted: Sat Oct 15, 2016 9:55 pm
by hidnplayr
On x86, 16 bit registers can be accessed when in 32 bit mode (such as protected mode) but why do you want to?
Nasm and fasm are basically different dialects of the intel assembly language.
Must read for fasm: https://flatassembler.net/docs.php%3Farticle%3Dmanual

Re: What is the difference between nasm and fasm?

Posted: Sat Oct 15, 2016 9:58 pm
by hidnplayr
Ps: programming in assembly is not just about learning the language, you need to learn the architecture, x86 in this case

Re: What is the difference between nasm and fasm?

Posted: Sun Oct 16, 2016 10:18 am
by zutokaza
Thank you. That cleared up somethings. I downloaded the source code from the SVN. I found most example code and code that I could integrate into a project I want to do in KolibriOS. I am not aiming for commercial use.

I am using Sasm (simple Open Source IDE for NASM, MASM, GAS and FASM assembler languages.) and flat assembler.

I have KolibriOS running in virtualbox. I was looking at and researching the libraries available. Do you know where I can find a simple example of the libimg?

Re: What is the difference between nasm and fasm?

Posted: Sun Oct 16, 2016 11:24 am
by hidnplayr
You can find the source code of libimg here: http://websvn.kolibrios.org/listing.php ... d53c34aa50
If you look in the .test folder, you'll find some test/demo programs.

Re: What is the difference between nasm and fasm?

Posted: Sun Oct 16, 2016 12:37 pm
by zutokaza
I found it. Thank you very much. Does KolibriOS have print screen? Also, can I calculate the area for the image dimensions for print screen? (If it exists.) I'd like to do this for easy image export.

Re: What is the difference between nasm and fasm?

Posted: Sun Oct 16, 2016 1:16 pm
by Leency
/rd/1/scrshot app or from menu-orher-screenshooter
No, sorry for now there is no tool to select copied area or crop image in Kolibri. Only full screen.

Re: What is the difference between nasm and fasm?

Posted: Sun Oct 16, 2016 1:39 pm
by hidnplayr
You can get the current screen resolution using system function 14.
You can get (a portion of) the screen pixels using system function 36
See http://websvn.kolibrios.org/filedetails ... sfuncs.txt

Re: What is the difference between nasm and fasm?

Posted: Sun Oct 16, 2016 4:15 pm
by Ray
One of the main advantages of the FASM is its new simple syntax to work with pointers. Just [] instead of "offset", "ptr" etc.

Re: What is the difference between nasm and fasm?

Posted: Sun Oct 16, 2016 4:19 pm
by 0CodErr
Ray, You're wrong, NASM uses [] instead of "offset", "ptr" etc.

Re: What is the difference between nasm and fasm?

Posted: Sun Oct 16, 2016 4:27 pm
by 0CodErr
hidnplayr, As it said in the documentation http://websvn.kolibrios.org/filedetails ... t#line-455 SysFn14 does not return real screen size. For this purpose need to use SysFn61.1 http://websvn.kolibrios.org/filedetails ... #line-2711

Re: What is the difference between nasm and fasm?

Posted: Sun Oct 16, 2016 5:32 pm
by Ray
0CodErr wrote:Ray, You're wrong, NASM uses [] instead of "offset", "ptr" etc.
It could be that it is already uses FASM like syntax for pointers. I didn't look at it for a very long time.

Re: What is the difference between nasm and fasm?

Posted: Sun Oct 16, 2016 5:42 pm
by 0CodErr
Ray, you wrote that FASM uses its new simple syntax. But this syntax already was in NASM. Actually FASM uses NASM-like syntax in many cases(exept macro-system of course). May be you don't know, that NASM appeared earlier than FASM?

Re: What is the difference between nasm and fasm?

Posted: Sun Oct 16, 2016 5:55 pm
by Ray
I do know that of course. But the syntax without [] is older than the syntax with [], isn't it?

Re: What is the difference between nasm and fasm?

Posted: Sun Oct 16, 2016 6:33 pm
by 0CodErr
Ray wrote:But the syntax without [] is older than the syntax with [], isn't it?
But this is not relevant to the current topic, isn't it?