Advertisement Jump to content
Sign in to follow this  
Xenoxi

Alternative opcodes

This topic is 4915 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 wondered if it was possible to 'exchange' various machine opcodes for alternative ones, opcodes that have the same (or practically) functionality, such as something that you could replace a nop (0x90) with, which still does as I like to say: 'naff all'. Cheers.

Share this post


Link to post
Share on other sites
Advertisement
Some chips were supposed to let you change the instruction set. Common x86 chips sure aren't. A NOP is a NOP is a NOP and nothing else.

Of course, that doen't mean you can't inject useless code in your program, like
   JMP label
label:

Share this post


Link to post
Share on other sites
Yeah that is what I had in mind essentially (the latter). Basically the nops I intended to change are the clusters of nops you get between functions, which is there for padding reasons.

The problem is i'm guessing this will cause a problem with function timing if I were to alter them at all. I guess i'll give this plan a miss then ahah.

Its basically something to do because i'm bored and its the summer.

Share this post


Link to post
Share on other sites
"this will cause a problem with function timing if I were to alter them at all"
eh? Replacing nops with instructions that take up more cycles won't destroy your program if that's what you were thinking. If it's padding between functions, the code would probably never be called, so you could probably change it to absolute garbage. The purpose of nop's in the middle of functions is to align loops properly because the CPU works faster that way.

Share this post


Link to post
Share on other sites
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!