|Re: [alpha][space] in WP34S|
Message #17 Posted by Neil Hamilton (Ottawa) on 10 Aug 2011, 8:48 a.m.,
in response to message #13 by fhub
I am not sure I follow yet -- language or no language.
The assembler regenerates the 'step' numbers from scratch unless you ask it not to with the '-ns' switch. (They are really steps, not lines.)
If you are trying to compare 2 files, one with step numbers to one without step numbers or with "different" step numbers, you can use a variety of command line tools to do this. Many O/S's have a command called "cut". You could try this on the files with line numbers and compare the 2 outputs:
$ cut -c 4- your-file-with-step-numbers > your-cleaned-filename
The 4 is appropriate for a file without the "000" type step numbers. If you have "000:" style, use "-c 5-".
If the comment sections get in the way, you will have to scrub those through other means. (This is more difficult with "/* ... */" because you need a state machine -- this is the main reason I personally favour the "//" style comment. They are trivial to deal with.)
$ grep -v "^[ \t]*//" your-file-with-step-numbers | cut -c 4- > your-cleaned-filename
Or, count the lines that need to be removed from the top:
$ tail -40 your-file-with-step-numbers | cut -c 4- > your-cleaned-filename
Where you must replace '-40' with the number of lines counting from the bottom that you are looking to compare.
Repeat this process for both files, if required, and run them through your favorite compare utility.