raw 32-bit assembler code?

Question about which tools to use, bugs, the best way to implement a function, etc should go here. Don't forget to see if your question is answered in the wiki first! When in doubt post here.
Post Reply
Paul

raw 32-bit assembler code?

Post by Paul »

Does anyone know if a raw 32-bit version of NASM exists, or some equivelant? What would really be useful is an assembler I can load into memory and all I have to do is set up a pointer to the source code in memory and a pointer to where I want the compiled (binary) code to go. And maybe another pointer to which to send error messages. Am I talking out of my @$$?

Can you see what I'm getting at? I am making my own protected mode OS and I even wrote my own text editor. What I want to do is be able to assemble code right from within my environment and not have to rely on Windows, Dos, or Linux anymore.

I think such an assembler is not so far fetched (maybe I need to make it myself if I can get the NASM source code). But I *REALLY* doubt I'd be able to do the same for a C compiler.....
Friend

Re:raw 32-bit assembler code?

Post by Friend »

Hi,

If you have an OS that is capable enough to run your text editor, then why dont you just get the source for NASM and then port it to your OS and run it like any other program?
Tom

Re:raw 32-bit assembler code?

Post by Tom »

To get 32-bit NASM code, at the top of your source file type in

[BITS 32]

I'll get your other answers later.
Paul

Re:raw 32-bit assembler code?

Post by Paul »

Friend: That is exactly my problem. I don't know where to get the source to nasm. And even if I do find it, I wonder how hard it will be to port. I assume it will be heavily integrated to a particular O/S (like Dos, Linux, or Windows.)

Tom: I didn't mean how do I compile 32-bit code, I meant I need a 32-bit assembler that I can run in my own protected mode environment.
Paul

Re:raw 32-bit assembler code?

Post by Paul »

I just found the source to NASM... but it looks REALLY complicated. :)
User avatar
Pype.Clicker
Member
Member
Posts: 5964
Joined: Wed Oct 18, 2006 2:31 am
Location: In a galaxy, far, far away
Contact:

Re:raw 32-bit assembler code?

Post by Pype.Clicker »

an assembler will probably not work with a *raw* format: it relies on console outputs, arguments reading, file operations (and thus file system) ...

before you can port an assembler to your OS, i fear you'll have to provide a program loader and a libc in that environment ...
Tim

Re:raw 32-bit assembler code?

Post by Tim »

The NASM source is very portable. As long as you've got a libc with basic I/O and a few support functions you'll be OK. I ported it to Mobius ages ago with no problems, and no modifications to the source.
Post Reply