Sign in to follow this  

machine code

This topic is 3739 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

The processor architecture manuals usually list the bit codes for various instruction combinations, you could refer to them.

However, this fits into the category of things to do that are a monumental waste of time. Why on earth do you want to write in machine code?

[Edited by - jpetrie on September 18, 2007 4:26:18 PM]

Share this post


Link to post
Share on other sites
Well, if you really want to get into this:

Intel Pentium 2 developer manual

It's really as simple as creating the PE header, and then putting in the correct opcodes, then putting in the correct data. Mind you, it's a little more complex than that (such as knowing where to reference the data before you have your actual program written), and as jpetrie stated, a complete waste of time. If you really want to go this low level, just use assembly. That's at least a readable version of this.

Share this post


Link to post
Share on other sites
That one's kind of old.

Current Intel Processor Manuals

The ones you want are Software Developer's Manual Volumes 1 and 2.

Be especially careful reading the section about the Mod/RM and SIB bytes and their special cases.

If you didn't want IA-32/64 architecture, I'm sure there are manuals for the other architectures out there somewhere. I've only done x86 myself.

Share this post


Link to post
Share on other sites
I don't know if I would call it FUN, but there are some very interesting things you can do if you understand how to write machine code on the fly as a program is already running.

Writing programs from scratch using machine code would be time consuming, but you'd very quickly learn how it works in practice. I find it more effective to look at the emitted disassembly of test programs in a debugger though (that way you can learn how the compiler optimizes the machine code).

Writing your own debugger or making an edit-and-continue system are good examples of actually using this knowledge.

Share this post


Link to post
Share on other sites
Quote:
Original post by Antheus
Quote:
Original post by taco13
Also, I understand it better than assembly.
No, I am not a psycho.


Why are you looking for resources then?


Don't feed the troll.

Share this post


Link to post
Share on other sites
I am looking for resources because what I ment by resources was a list of the opcodes to refrence. I had searched intel before but couldn't find it so I didn't know where it was.

Share this post


Link to post
Share on other sites
Taco13, sorry if I being rude, but I have serious doubts that you can read machine code better that assembly or high level languages. And as the guys have already said, programming in machine code is a total waste of time, no one does it anymore(at least on a big scale). If you really have an interest on low level programming, then you should use assembly because programming in machine code complicates (a lot!) what is already very complicated.

And please, dont tell us that you only use machine code because it's prettier, that's a really lousy explanation that only makes me doubt even more that you can really program more efficiently in it than in higher level languages.

Share this post


Link to post
Share on other sites
I remember one time I made a program in machine code that printed the numbers 1 to 10 to the screen, it was fun, but time consuming. And if you can read machine code with ease, doesn't that also mean you're familliar with all the instructions and thus assembly should be even easier? :confused:

When I was fiddling with machine code, I just used a disassembler and translated the assembly opcodes.

Share this post


Link to post
Share on other sites
Quote:
Original post by jcabeleiraAnd please, dont tell us that you only use machine code because it's prettier, that's a really lousy explanation that only makes me doubt even more that you can really program more efficiently in it than in higher level languages.


Where did he say that? Not everyone has to worry about productivity or efficiency. There are other things, you know, challenge, fun, things like that... What's wrong with wasting some time doing something you enjoy?

JA

Share this post


Link to post
Share on other sites
Quote:
Original post by janta
Quote:
Original post by jcabeleiraAnd please, dont tell us that you only use machine code because it's prettier, that's a really lousy explanation that only makes me doubt even more that you can really program more efficiently in it than in higher level languages.


Where did he say that? Not everyone has to worry about productivity or efficiency. There are other things, you know, challenge, fun, things like that... What's wrong with wasting some time doing something you enjoy?

JA


You're right, I'm sorry. I understand that sometimes the challenge is more important than making a useful program, what I don't understand is how can someone say that he can understand machine code better than higher level languages when he previously said that it's harder to read. So you have more troubles reading machine code than assembly but you find it easier to understand?

Quote:
I think it's just more fun than the higher level languages. I also like the fact that it is harder to read.


Quote:
Also, I understand it better than assembly. No, I am not a psycho.


Taco13, if you really want to use machine code then go ahead, who knows if you learn something useful from it, but I think you shouldn't waste too much time on it.

Share this post


Link to post
Share on other sites

This topic is 3739 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

Sign in to follow this