Author Topic: adding support for another architecture  (Read 17779 times)

nobody

  • Guest
adding support for another architecture
« on: December 22, 2008, 05:07:04 AM »
Hi there,

I would like to try to add support for another architecture thats "fake" for my own purposes. Is it doable? easy? hard? Am I better of writing my own assembler?

My Motives: I'm young so my motives/ideas are sometimes useless if so I appreciate understanding why :)

I want to try to create something like flash but free with 3D acceleration and other ambitious details ;). So I looked into it and thought I should use SDL, OpenGL so it would be easy to port to other OS's. Next up comes the byte code, I looked into LUA but then I thought I really want to have a C syntax so old code can be more easily ported, the closer to C the better. So I thought why not make a interpreter; so I started working on it, and use ghex to write small programs to test it out, so far it works though it only supports like a print command, I want to test out other more features of the interpreter but ghex is really bother some as an assembler. Next up is write assembler. I started writing one but its complex, so I thought to maybe modify NASM.

So I searched the forum if anyone did similar; I found a post on Macho-o by Frank where I learned about the Output Format Driver. Looks promising to what I need. I'm slowly starting to see how it fits into the big picture; I don't know what to do next?

And now I'm here asking questions:
Is the Output Format driver is what I'm looking for? in nasm.h the params are not explained, is there a place where they are? e.g. the output() function params are not explained but what the function does is. Whats  required to be done so NASM will support a new architecture?

Thank you
Ben

nobody

  • Guest
Re: adding support for another architecture
« Reply #1 on: January 06, 2009, 10:41:44 PM »
I wrote an assembler. I didn't manage to have nasm support it, but I did look at nasm for help writing one. The assembler managed to assemble a hello world program for the custom arch; which it ran fine :). Didn't work the first time but eventually got it :).

Looking at nasm source it looks like its specialized for x86. Well atleast I got an assembler now :).

Ben