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.....
raw 32-bit assembler code?
Re:raw 32-bit assembler code?
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?
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?
Re:raw 32-bit assembler code?
To get 32-bit NASM code, at the top of your source file type in
[BITS 32]
I'll get your other answers later.
[BITS 32]
I'll get your other answers later.
Re:raw 32-bit assembler code?
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.
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.
Re:raw 32-bit assembler code?
I just found the source to NASM... but it looks REALLY complicated.
- Pype.Clicker
- 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?
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 ...
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 ...
Re:raw 32-bit assembler code?
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.