Jump to content
  • Advertisement
Sign in to follow this  
quiltkickkiller

How to program in machine code and problem learning assembly....

This topic is 2588 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

I would like to write applications using no APIs or programming languages - just machine code. I figured I can translate the assembler's instructions, but I'd have to understand Assembly 100% beforehand. Is it all one language? How does it work? How come there's different kinds of "Assembler" programs if the language is supposed to be the same? How can a program write another program?

And how do you write directly to RAM in OS runtime?

But yeah, it's either gonna be machine code, everything, graphics and all, or nothing.

Share this post


Link to post
Share on other sites
Advertisement
Well to do code with no API's in assembler you're going to first need to write your own OS, followed by an assembler.

There are different assemblers because assembler is human readable machine code. They all have their own ways of compiling an executable, which is definied by the operating system. Intel usually publishes documents detailing the instruction set of the CPU, but good luck writing your own OS. Maybe study the linux kernal source or Free DOS.

Share this post


Link to post
Share on other sites
May I ask why would you like to write applications directly in assembler instruction? What benefits do you expect from that?

Share this post


Link to post
Share on other sites

I would like to write applications using no APIs or programming languages - just machine code. I figured I can translate the assembler's instructions, but I'd have to understand Assembly 100% beforehand.
[/quote]
Fair enough, but going below the level of assembly doesn't yield much of interest.


How come there's different kinds of "Assembler" programs if the language is supposed to be the same?
[/quote]
Each architecture has it's own machine language. Even if it didn't, there is nothing stopping two people writing different assemblers for the same architecture. There are plenty of reasons to do this, one might be more efficient than another, it might generate more descriptive error messages, it might have some simple extensions to help development, or it might be free or open source as opposed to expensive or proprietary.

Or, like yourself, you could have people who decide they must write their own.


How can a program write another program?
[/quote]
What is a program? A program is just data. Your program can output data to memory or to a file that can itself be interpreted as a program.


And how do you write directly to RAM in OS runtime?
[/quote]
Read the documentation for the processor you are targeting. Some instructions allow you to read or write to memory rather than to registers.

Share this post


Link to post
Share on other sites
The OP is a known troll that likes to show up every couple of weeks. He's been dealt with.

As such, there should be no need to keep this thread open.

Share this post


Link to post
Share on other sites

This topic is 2588 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.

Guest
This topic is now closed to further replies.
Sign in to follow this  

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

GameDev.net is your game development community. Create an account for your GameDev Portfolio and participate in the largest developer community in the games industry.

Sign me up!