flat assembler
Message board for the users of flat assembler.

Index > Non-x86 architectures > x86-64 extensions

Author
Thread Post new topic Reply to topic
goobaby78



Joined: 13 Jul 2011
Posts: 1
goobaby78 13 Jul 2011, 23:49
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
typedef 14 Jul 2011, 00:05
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: 20451
Location: In your JS exploiting you and your system
revolution 14 Jul 2011, 00:24
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: 676
Location: Mar del Plata
Enko 14 Jul 2011, 02:30
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



Joined: 16 Jun 2003
Posts: 8359
Location: Kraków, Poland
Tomasz Grysztar 14 Jul 2011, 07:19
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


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

Website powered by rwasa.