3.3 Comparing Variants of a Source File

As we have repeatedly implied, assembly language is not very friendly, in the sense that the programmer must attend to many small details that compilers for high-level languages perform behind the scenes. For most of us, spotting tiny differences among already small details is rather difficult for our eye-brain coordination.

Many programming environments provide some sort of standard utility program to compare two virtually identical text files and find the differences. The utility program reads both versions and shows those lines where differences occur and the contexts in which whole lines may have been inserted or deleted. The simplest comparison command is the same for the Linux and HP-UX programming environments:

 L> diff file1 file2 H> diff file1 file2 

There are numerous options and variations of the basic command shown here, and you may wish to consult available system documentation or use the online help (man diff).

It is not at all uncommon to get a program working nicely and then make "just a couple of tiny changes," only to find that it then performs badly or not at all. Rather than scan through manually, perhaps forgetting that you made five "tiny changes" and not two, we think you will find this command well worth remembering and using.

You should make a habit of regular file backups. For instance, each edit of the prog.s file could be named using a scheme such as prog20020523T1707.s that incorporates an ISO® 8601 date and time.



ItaniumR Architecture for Programmers. Understanding 64-Bit Processors and EPIC Principles
ItaniumR Architecture for Programmers. Understanding 64-Bit Processors and EPIC Principles
ISBN: N/A
EAN: N/A
Year: 2003
Pages: 223

flylib.com © 2008-2017.
If you may any questions please contact us: flylib@qtcs.net