October 4, 2013 (v01.01.06) From this point forward, I will describe changes in the blog. The decodexxx.txt file will be the place I record them from now on. October 3, 2013 (v01.01.05a) Re-arranged the TYPE, DIM and PARAM statements for better organization. Changed the data files output by decode to have the .txt extension instead of the .b09 extension. Added code to write the variables to Vars.txt. March 4, 2012 (v01.01.05) Fixed a bug where no space was placed between a ELSE keyword and a variable reference when both occur between line terminators. March 1, 2012 (v01.01.04) Minor revision: Fixed GOTO/GOSUB (note the 2 spaces). Major revision: Accounted for RESTORE with no linenum. February 29, 2012 (v01.00.03) Fixed a problem with a special case of the use of ON variable GOTO/GOSUB. Added the decode.1.x.x notes file for mode in-depth explanations. This file will reflect in its name the current revision of decode. February 28, 2012 (v01.00.02) Fixed a problem where MID$ was not receiving its third argument, which also affected matrix arrays. February 27, 2012 (v01.00.01) Fixed a problem where field variables were not being sorted to the top of the variables file, causing incorrect TYPE statement construction. February 23, 2012 (v01.00.00) I finally have decode completed enough to produce source code. The three problems remaining are: sporadic instructions not parsed correctly (1 found so far) variables incorrectly defined (1 found so far, field-related) type statements incorrectly defined (a few so far) The last two are directly related to the incomplete state of the DSAT routine. Version 2 of decode will address these issues. I welcome any and all reports of code not being properly reproduced. Effective immediately, the version number for decode, defVars, buildSrc and instruction is officially 1.0.0. I am calling this the beta release. February 9, 2012 I have been working on decode again for about a month. I had done more to it since the last update to this file, and had failed to include those changes. However, the files for that work still exist and can be viewed if anyone really wants to see how many different changes took place. Effective immediately, The current decode is still version 0.x, but I am now calling it 0.5. What was fmato became defVars, and is also given the version 0.5. The latest fmato is version 4.0 (the previous 4.0 was a version of the decode module and is not part of this series). I finally got my hands on a complete ribbs 2.10 distribution, and now have the ability to test decode against all of the I-Code modules in the package. Decode now works much faster and much more properly than the previous versions did. Ribbsmain decodes in a little under 6 minutes. Connect decodes in a little less than 17 minutes. Aaron Wolfe helped me with a bubble-sort routine that decreased the time spent sorrting the records, and he also helped me with a faster search routine. Since that time, I have gained a better understanding of quick-sort, and using a copy of the quick-sort routine in the Basic09 manual, I devides quick-sorts for the variables references and the line references. Field records are supplementally sorted with the bubble-sort routine, as they require a special condition and I (as yet) have not determined how to work this condition into a quick-sort. I will add further information here as I progress. It looks like it won't be much longer and I'll be ready to begin work on the source code parser, which is the final step of the decoding process. November 12, 2009 I removed the version comments from the source file. Hereon, I will put version info here. Because of the addition of a second procedure, I found it necessary to rename. I like using fmato as a development name, so each new procedure added will be named fmato while under development, and will be renamed when it is complete. What was fmato is now decode. The second procedure is named fmato. The source file names are: decode.B09 fmato3b.B09 November 10, 2009 About decode decode is not as fast as I wish it were, but I understand why, and at this point it can wait until I have things figured out on how to properly interpret the I-Code. I'm making good progress, but there is still much to do. The fmato procedure is still under development, and therefore is not optimized. Run decode on a small procedure first so you can see how it operates. I don't recommend viewing the decode on large modules. They may have over 1,000 instructions, thousands of references, and rconfig takes 42 minutes to complete the decode routine without watching it. You can add at least a few minutes if you choose to watch it on a larger file. The searches are minimal, linear searches. They were written to just get the search done. I have been more focused on getting the decode to work and display the results for me than whether the search was totally efficient or not. I plan to improve them later. Note that the speed of the searches *does* affect the speed of the decode. The same applies to the sorts, with the following additions. First they are just a sift-type sort that run from top-to-bottom then bottom-to-top on each pass through the records. It works, but it could be better. The elapsed time routine works. Some Basic09 numbers on this version: ========================== Source Packed Proc-Size Data-Size Proc-Size Data-Size decode 24757 1111 18961 1111 ========================== Source Packed Proc-Size Data-Size Proc-Size Data-Size fmato 4794 308 3131 874 ========================== decode *does NOT* support merged module files, and *does NOT* detect non-I-Code modules or files. The following are definitions of what shows up in the decode if you view it. The view window now contains this at the bottom of the window. {x0 x000 } detected a variable reference (x0 x000) detected a line reference, x0 replaced with keyword where applicable [0x ref] detected a literal reference, ref can be x0 BYTE x0000 HEX i00000 INTEGER r0000000000 REAL chars STRING <* x0000 *> detected a FOR/NEXT pair identifier Strings are displayed as characters, with quotes. The literal swap only displays the left 37 characters of the string, if it is longer. String length maximum is 80. latest version decode - was fmato, added CHAIN statement. new procedure now named fmato. fixed display problems, elapsed time functions. corrected an error in the literal sort routine. fmato3.0b - new fmato, second procedure. Displays unsorted variable references. old versions 0.3a - reduced code size and fixed some display problems 0.4b - an attempt to split the procedure into multiple procedures 0.3 - sorts and assigns line references, sorts literal references, and begins association of variable references to the VDT and DSAT added display and overlay functions, reorganized code 0.2 - creates record files for variable, line reference, and literal data organized variable declarations, added comments, added flow control to file creation 0.1 - identifies and counts all relevent data in header and instruction code decode time: 1:37:47, actual 2 hours sort lits time: 3:02:56, actual 5 hours