Board.KolibriOS.org

Official KolibriOS board
It is currently Thu Nov 21, 2019 12:39 am

All times are UTC+03:00




Post new topic  Reply to topic  [ 16 posts ]  Go to page 1 2 Next
Author Message
PostPosted: Sat Oct 15, 2016 9:04 pm 
Offline

Joined: Sat Oct 03, 2015 6:56 am
Posts: 11
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?


Top
   
PostPosted: Sat Oct 15, 2016 9:55 pm 
Offline
Mentor/Kernel Developer
User avatar

Joined: Fri Jun 30, 2006 9:01 am
Posts: 1248
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

_________________
"Any intelligent fool can make things bigger, more complex, and more violent. It takes a touch of genius -- and a lot of courage -- to move in the opposite direction." Albert Einstein


Top
   
PostPosted: Sat Oct 15, 2016 9:58 pm 
Offline
Mentor/Kernel Developer
User avatar

Joined: Fri Jun 30, 2006 9:01 am
Posts: 1248
Ps: programming in assembly is not just about learning the language, you need to learn the architecture, x86 in this case

_________________
"Any intelligent fool can make things bigger, more complex, and more violent. It takes a touch of genius -- and a lot of courage -- to move in the opposite direction." Albert Einstein


Top
   
PostPosted: Sun Oct 16, 2016 10:18 am 
Offline

Joined: Sat Oct 03, 2015 6:56 am
Posts: 11
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?


Top
   
PostPosted: Sun Oct 16, 2016 11:24 am 
Offline
Mentor/Kernel Developer
User avatar

Joined: Fri Jun 30, 2006 9:01 am
Posts: 1248
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.

_________________
"Any intelligent fool can make things bigger, more complex, and more violent. It takes a touch of genius -- and a lot of courage -- to move in the opposite direction." Albert Einstein


Top
   
PostPosted: Sun Oct 16, 2016 12:37 pm 
Offline

Joined: Sat Oct 03, 2015 6:56 am
Posts: 11
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.


Top
   
PostPosted: Sun Oct 16, 2016 1:16 pm 
Offline
Designer
User avatar

Joined: Thu Jan 25, 2007 3:33 pm
Posts: 5066
/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.

_________________
Через тернии к звездам


Top
   
PostPosted: Sun Oct 16, 2016 1:39 pm 
Offline
Mentor/Kernel Developer
User avatar

Joined: Fri Jun 30, 2006 9:01 am
Posts: 1248
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

_________________
"Any intelligent fool can make things bigger, more complex, and more violent. It takes a touch of genius -- and a lot of courage -- to move in the opposite direction." Albert Einstein


Top
   
PostPosted: Sun Oct 16, 2016 4:15 pm 
Offline

Joined: Sun Aug 09, 2015 3:41 pm
Posts: 110
One of the main advantages of the FASM is its new simple syntax to work with pointers. Just [] instead of "offset", "ptr" etc.


Top
   
PostPosted: Sun Oct 16, 2016 4:19 pm 
Offline

Joined: Sun Oct 30, 2011 6:43 pm
Posts: 1499
Ray, You're wrong, NASM uses [] instead of "offset", "ptr" etc.


Top
   
PostPosted: Sun Oct 16, 2016 4:27 pm 
Offline

Joined: Sun Oct 30, 2011 6:43 pm
Posts: 1499
hidnplayr, As it said in the documentation http://websvn.kolibrios.org/filedetails.php?repname=Kolibri+OS&path=%2Fkernel%2Ftrunk%2Fdocs%2Fsysfuncs.txt#line-455 SysFn14 does not return real screen size. For this purpose need to use SysFn61.1 http://websvn.kolibrios.org/filedetails.php?repname=Kolibri+OS&path=%2Fkernel%2Ftrunk%2Fdocs%2Fsysfuncs.txt#line-2711


Top
   
PostPosted: Sun Oct 16, 2016 5:32 pm 
Offline

Joined: Sun Aug 09, 2015 3:41 pm
Posts: 110
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.


Top
   
PostPosted: Sun Oct 16, 2016 5:42 pm 
Offline

Joined: Sun Oct 30, 2011 6:43 pm
Posts: 1499
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?


Top
   
PostPosted: Sun Oct 16, 2016 5:55 pm 
Offline

Joined: Sun Aug 09, 2015 3:41 pm
Posts: 110
I do know that of course. But the syntax without [] is older than the syntax with [], isn't it?


Top
   
PostPosted: Sun Oct 16, 2016 6:33 pm 
Offline

Joined: Sun Oct 30, 2011 6:43 pm
Posts: 1499
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?


Top
   
Display posts from previous:  Sort by  
Post new topic  Reply to topic  [ 16 posts ]  Go to page 1 2 Next

All times are UTC+03:00


Who is online

Users browsing this forum: MSN [Bot] and 6 guests


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 post attachments in this forum

Search for:
Jump to:  
Powered by phpBB® Forum Software © phpBB Limited