Best Answer Luthfi , 26 January 2013 - 10:20 AM
Unfortunately I don't have ready-to-use codes at hand. But like I have said, it's not difficult. Why don't you start coding and I will help you should you feel stuck.
Basically you would do these (this is just one approach, not the only one):
- Load the bytes into a TStream instance (I recommend TMemoryStream, with the help of TFileStream if the bytes stored in a file).
- Read a byte from the TStream instance.
- By using the translation table, decode the byte into correct TMnemonic class and instantiate the class.
- Feed the stream to the just created TMnemonic instance so it be able to decode the parameters.
- Go to step #2, repeat until all the bytes processed.
I found some free time and wrote sample implementation using OOP approach I've suggested. Check out the attached source code. Note that I only implemented "PUSH" class. And also I changed the Label property of TMnemonic class into Code because previously I forgot that Label was reserved word.
Enjoy! Go to the full post