flat assembler
Message board for the users of flat assembler.
 Home   FAQ   Search   Register 
 Profile   Log in to check your private messages   Log in 
flat assembler > Non-x86 architectures > x86-64 extensions

Author
Thread Post new topic Reply to topic
goobaby78



Joined: 13 Jul 2011
Posts: 1
x86-64 extensions
Hello,

I'm working on a project and proposing some extensions for the x86-64 ISA. The topical part is that I'm not following the x86 convention at all. There is a prefix that we're reserving and then it's the wild west after Very Happy

So far I've been placing statements in my C file like this

Code:
asm(".byte 0xF1, 0B0001");



This is tedious, error-prone and the biggest disadvantage is that I can't use GCC's asm constraints. The last feature would let me specify variables in lieu of registers.

I'm curious, how difficult would it be to extend fasm to introduce my insructions? Are there some documents to help get started? What would the developers suggest? I had looked at GAS before but it's so rigid and complicated that it would not be worth the effort for such a small project.

Also, will there be problems if I compile the top-level C file with GCC, the assembly with FASM and then link it all with GNU LD?

Thanks so much Smile

EDIT: I should clarify that the extensions are being designed for an x86-64 hardware simulator.
Post 13 Jul 2011, 23:49
View user's profile Send private message Reply with quote
typedef



Joined: 25 Jul 2010
Posts: 2909
Location: 0x77760000
FASM ==> project.obj
GCC_Linker ==> project.obj ===> project.exe
Post 14 Jul 2011, 00:05
View user's profile Send private message Reply with quote
revolution
When all else fails, read the source


Joined: 24 Aug 2004
Posts: 15295
Location: Bigweld Industries
Isn't 0xF1 reserved for the ICE hardware?

goobaby78: Are you making your own CPU? If not then how do you intend to introduce the new instructions into a chip?
Post 14 Jul 2011, 00:24
View user's profile Send private message Visit poster's website Reply with quote
Enko



Joined: 03 Apr 2007
Posts: 668
Location: Mar del Plata
He edited the post, its designed for an x86-64 hardware simulator.
Post 14 Jul 2011, 02:30
View user's profile Send private message Reply with quote
Tomasz Grysztar
Assembly Artist


Joined: 16 Jun 2003
Posts: 6673
Location: Kraków, Poland
There is a small tutorial on adding custom instruction handlers to fasm: http://board.flatassembler.net/topic.php?t=208
It is from 2003, so you may find that some things were changed/extended in the meantime, but the basic principles are still the same.
Post 14 Jul 2011, 07:19
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:  


< 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


Powered by phpBB © 2001-2005 phpBB Group.

Main index   Download   Documentation   Examples   Message board
Copyright © 2004-2016, Tomasz Grysztar.