Jump to content
  • Advertisement

Archived

This topic is now archived and is closed to further replies.

snyp

0's and 1's

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

Do you know how I can write native machine code?? 0''s and 1''s to make a prog, is there anything like that? Just wondering...

Share this post


Link to post
Share on other sites
Advertisement
Take an hex editor and start typing. Of course, it helps to know what you''re doing.

Share this post


Link to post
Share on other sites
There''s no reason to.. If you just write in assembly, every line of assembly corresponds exactly with one machine code instruction, so you wouldn''t gain anything from writing machine code directly.

Share this post


Link to post
Share on other sites
Assembler is a "translation" of machine code. So that''s probably the lowest level language you will use. I suppose you could find the instruction coding formats and type the program directly in machine code, but that''s just crazy and a waste of time.

Share this post


Link to post
Share on other sites
quote:
Original post by Sante05
Assembler is a "translation" of machine code. So that''s probably the lowest level language you will use. I suppose you could find the instruction coding formats and type the program directly in machine code, but that''s just crazy and a waste of time.


Not having an assembler handy on my old man''s PC, I like to tweak graphic demos by using debug at the command line prompt. Which, of course, allows you to view the assembly code of a program and edit the contents of a file byte per byte.

I''ve managed to significantly alter a waterfall demo like that. I feel pretty spiffy about it.

But it has absolutely no use nor any point whatsoever and happens to be rather counter-productive considering all the tools available nowadays.

Share this post


Link to post
Share on other sites
quote:
Original post by RuneLancer
But it has absolutely no use nor any point whatsoever and happens to be rather counter-productive considering all the tools available nowadays.


I use it at school when I get tired of java.

Share this post


Link to post
Share on other sites
quote:
Original post by DukeAtreides076
I use it at school when I get tired of java.


Eh, my bad. It helps alleviate boredom.

Share this post


Link to post
Share on other sites
Are you saying assembler is ''out of business'', then if you think that, why don''t you just optimize your code in Java, its the slowest language I could think up at the moment...

Share this post


Link to post
Share on other sites
quote:
Original post by snyp
Are you saying assembler is 'out of business', then if you think that, why don't you just optimize your code in Java, its the slowest language I could think up at the moment...


Currently, compilers are far too performant to be worth trying to beat. If you're gonna write something that requires speed, your best bet is to write it in C/C++ (using a good compiler) and to add inline assembly tweaks and hacks here and there when you can get a good boost out of it (for instance, using processor-specific things such as the MMX instruction set).

To write a game, nowadays, a good algorithm will beat pretty much anything else in terms of performance, no matter what language you use. A very badly optimized C++ sorting algorithm will probably be beaten by a very clever Java algorithm.

I challenge you to write a game in assembly and then in a higher-end language such as C++ or even VB. Unless you're an assembly god and make use of processor-specific extensions, you'll see no difference or the non-assembly program will probably be slightly faster to much faster.

Edit: On the subject of 1 and 0s, there are assembly compilers available such as NASM that allow you to write the mnemonic directly instead of the counter-productive 11010101 01010101 01010111... Why memorize opcodes when you can memorize much more significant mnemonics?

[edited by - RuneLancer on May 12, 2004 12:25:18 AM]

Share this post


Link to post
Share on other sites

  • Advertisement
×

Important Information

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

We are the game development community.

Whether you are an indie, hobbyist, AAA developer, or just trying to learn, GameDev.net is the place for you to learn, share, and connect with the games industry. Learn more About Us or sign up!

Sign me up!