Author Topic: General Hex code question  (Read 1947 times)

Offline ClassifiedModz

  • Classified-Modz
  • Guppy
  • *
  • Posts: 4
  • Post quality +0/-0
  • Gender: Male
  • De-Classified-Modz
    • Classifiedcontrollers
General Hex code question
« on: February 13, 2012, 05:45:39 AM »
Hey guys.
I have a few rapid fire hex codes, one of them is a 10 mod which is non adjustable , all set speeds.
I have another which is a 8 mod but it is an adjustable mod, all its modes can be adjusted by the user....

I want to make the 10 mod that is non adjustable into an adjustable.
Is it possible to find the section in the adjustable's hex code to copy and paste into the 10 mod non adjustable in order to make it adjustable ?

I've spent about 3 weeks trying to add modes to the 8 mod as well as make the 10 mod adjustable simply by copying from one to the other without any joy....

I am starting to think that the hex code is mixed up, so you cannot copy and paste....

Any idea's on this would be great.

Offline w02057

  • Chief squatting Hard
  • *
  • Posts: 12
  • Post quality +0/-0
  • Acidmods User
Re: General Hex code question
« Reply #1 on: July 13, 2012, 09:13:45 AM »
You could always ask me to change the spec for you.

Offline SethMods

  • Registered BST
  • King of the Wii-tards
  • *
  • Posts: 189
  • Post quality +17/-1
  • Gender: Male
  • Acidmods User
Re: General Hex code question
« Reply #2 on: July 13, 2012, 10:52:59 AM »
One of the biggest things that makes this so hard to do is that all the jumping around in the code--as the PIC carries out its instructions--is done by a goto command (no matter whether the original code was written in C, Basic, or Assembly). And the goto commands use absolute address referencing.

So let's say you have a goto that points to the beginning of mode 8. If you add  any extra code into the middle of the hex, it is going to offset the location of any code that follows. So now that goto may really point to somewhere in the middle of mode 7.


Also, each line in the hex code refers to a point in memory on the PIC. So if you just copy and paste from a hex file then you are likely writing over a given spot twice (once with the 8 mode code and once with the 10 mode code.) ...ultimately losing code in the progress.


You can "disassemble" the hex code to get it back to "assembly", but it's very cryptic to read and without knowing the writer's original intent it is almost impossible to make the necessary changes.


Just my 2 cents.

Offline Modded Matt

  • Site Owner
  • Administrator
  • Around the block
  • *
  • Posts: 4649
  • Post quality +65/-3
  • Gender: Male
Re: General Hex code question
« Reply #3 on: July 13, 2012, 12:54:43 PM »
Seth is right on. No two minds think alike, so it is almost impossible to just pick up someones code and just add to it without input from the author. finding the correct value and changing the fire rates is one thing, changing the code to do something it was not originally designed to do is a whole other ball of wax.

 

SMF spam blocked by CleanTalk
SimplePortal 2.3.5 © 2008-2012, SimplePortal