X86 ASM

I am working on a fun project, but need some help. How do you convert something like:
mov $5, %eax

into byte form that the computer can read. Does anyone have a tutorial/web page?

thanks in advance :)
You need an assembler. The current favorite is NASM.

http://www.nasm.us/
Well assembly has a one to one correspondence between it and a binary command. So yea in theory you could write this all in binary if you find a translation table for your given platform.
I am running an i3 Intel CPU. Where would I find a translation table for this platform?
@cire thanks for the link, but in the pdf, what is the section I am looking for called?
Well, that's a fine level of helplessness.
Come on Script Coder, you want to write those bytes by hand? You might as well use a magnetized, rusty nail.

Just use NASM instead. (Intel syntax.)
1
2
mov eax, 5
f¸   

I suppose, its just I want to not have to depend on another/someone else's product. What happens if NASM goes poof? also, would it not be a good learning experience?
There's really no reason to program in machine code. You'd get a better learning experience from ASM. Doing things in machine code would be about as benaficial as programming in Malbolge or Brainfuck
I suppose, its just I want to not have to depend on another/someone else's product. What happens if NASM goes poof?

What happens if your computer goes poof?
You grab a pencil and a notebook. Until they go poof too.
That is probably the most ridiculous statement. That's like sayin you wanna go back to the Stone Age because you don't wanna rely on anything that anyone has accomplished.
its just I want to not have to depend on another/someone else's product. What happens if NASM goes poof?
Wow.
Then why even write in x86 machine language? Go mine copper and silicon, reinvent modern electronics, design and build your own computer from scratch, and program it in its own machine language. Bonus points if you invent a superior alternative to the transistor in the process.
And none of that buying mining tools BS. Go find a few rocks and sticks and build up from there.
Topic archived. No new replies allowed.