home *** CD-ROM | disk | FTP | other *** search
Text File | 1993-10-28 | 72.4 KB | 1,623 lines |
-
-
-
-
-
-
-
-
-
- PC_Opt
- version 1.1
-
-
-
- User's Guide
-
-
-
-
- Copyright (c) 1993 Optimite Systems.
- All Rights Reserved.
-
- DEFINITION OF SHAREWARE
-
- Shareware distribution gives users a chance to try software before buying
- it. If you try a Shareware program and continue using it, you are expected
- to register. Individual programs differ on details -- some request
- registration while others require it, some specify a maximum trial period.
- Copyright laws apply to both Shareware and commercial software, and the
- copyright holder retains all rights, with a few specific exceptions as stated
- below. Shareware authors are accomplished programmers, just like
- commercial authors, and the programs are of comparable quality. (In both
- cases, there are good programs and bad ones!) The main difference is in
- the method of distribution. The author specifically grants the right to copy
- and distribute the software, either to all and sundry or to a specific group.
- For example, some authors require written permission before a
- commercial disk vendor may copy their Shareware. Shareware is a
- distribution method, not a type of software. You should find software that
- suits your needs and pocketbook, whether it's commercial or Shareware.
- The Shareware system makes fitting your needs easier, because you can
- try before you buy. And because the overhead is low, prices are low also.
- Shareware has the ultimate money-back guarantee -- if you don't use the
- product, you don't pay for it.
-
- DISCLAIMER - AGREEMENT
-
- Users of PC_Opt must accept this disclaimer of warranty: "PC_Opt is
- supplied as is. The author disclaims all warranties, expressed or implied,
- including, without limitation, the warranties of merchantability and of
- fitness for any purpose. The author assumes no liability for damages,
- direct or consequential, which may result from the use of PC_Opt."
- PC_Opt is a "shareware program" and is provided at no charge to the user
- for evaluation. Feel free to share it with your friends, but please do not
- give it away altered or as part of another system. The essence of
- "shareware" software is to provide personal computer users with quality
- software without high prices, and yet to provide incentive for
- programmers to continue to develop new products. If you find this
- program useful and find that you are using PC_Opt and continue to use
- PC_Opt after a reasonable trial period, you must make a registration
- payment of $15.00 to Optimite Systems. The $15.00 registration fee will
- license one copy for use on any one computer at any one time. You must
- treat this software just like a book. An example is that this software may
- be used by any number of people and may be freely moved from one
- computer location to another, so long as there is no possibility of it being
- used at one location while it's being used at another. Just as a book cannot
- be read by two different persons at the same time. Commercial users of
- PC_Opt must register and pay for their copies of PC_Opt within 30 days
- of first use or their license is withdrawn. Site-License arrangements may
- be made by contacting Optimite Systems. Anyone distributing PC_Opt for
- any kind of remuneration must first contact Optimite Systems at the
- address below for authorization. This authorization will be automatically
- granted to distributors recognized by the (ASP) as adhering to its
- guidelines for shareware distributors, and such distributors may begin
- offering PC_Opt immediately (However Optimite Systems must still be
- advised so that the distributor can be kept up-to-date with the latest
- version of PC_Opt). You are encouraged to pass a copy of PC_Opt along
- to your friends for evaluation. Please encourage them to register their
- copy if they find that they can use it. All registered users will receive a
- printed manual, information on product enhancements, ninety days of free
- support, and a copy of the latest version of the PC_Opt.
-
- Support for Registered Users
-
- Users will receive ninety days free support upon registering PC_Opt. This
- support will be by mail and compuserve email. Additional phone support
- will be supplied if all other means of support do not resolve the problem.
- We are limited in the amount of phone support we can provide because of
- the low registration fee.
-
- This program is produced by a member of the Association of Shareware
- Professionals (ASP). ASP wants to make sure that the shareware principle
- works for you. If you are unable to resolve a shareware-related problem
- with an ASP member by contacting the member directly, ASP may be
- able to help. The ASP Ombudsman can help you resolve a dispute or
- problem with an ASP member, but does not provide technical support for
- members' products. Please write to the ASP Ombudsman at 545 Grover
- Road, Muskegon, MI 49442 or send a CompuServe message via
- CompuServe Mail to ASP Ombudsman 70007,3536."
-
-
-
- How To Register
-
- Simply print and fill out the form in listed in the file order.doc
- and send along with a check or money order for $15.00 (+ 5.00 shipping &
- handling) to:
-
- Optimite Systems
- 1000 Singleton Blvd.
- Dallas, Texas 75212
-
- In registering this software, you are helping us in our efforts to continue
- to improve and extend optimization technology to new platforms. As
- mentioned previously, all registered users will receive a printed manual,
- information on product enhancements, ninety days of free support, and a
- copy of the latest version of the PC_Opt.
-
-
- Trademarks
-
- PC_Opt is a trademark of Optimite Systems
-
- Borland C++ is a trademark of Borland International, Inc.
-
- OS/2 is a trademark of IBM corporation
-
- INTEL is a trademark of Intel, Inc.
-
- Microsoft C and MS-DOS are trademarks of Microsoft Corporation
-
- Windows is a registered trademark of Microsoft Corporation.TABLE OF CONTENTS
-
- INTRODUCTION . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1
-
- REQUIREMENTS . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1
-
- GENERAL CAPABILITIES . . . . . . . . . . . . . . . . . . . . . . . . 2
-
- DISTRIBUTION DISKETTE CONTENTS . . . . . . . . . . . . . . . . . . . 2
-
- STEP BY STEP OPERATION . . . . . . . . . . . . . . . . . . . . . . . 2
-
- CHAPTER 1 COMMAND LINE OPTIONS . . . . . . . . . . . . . . . . . . 4
- /rxxxx . . . . . . . . . . . . . . . . . . . . . . . . 4
- /oxxxx . . . . . . . . . . . . . . . . . . . . . . . . 5
- /sxxxx . . . . . . . . . . . . . . . . . . . . . . . . 5
- /lxxxx . . . . . . . . . . . . . . . . . . . . . . . . 5
- /mxxxx . . . . . . . . . . . . . . . . . . . . . . . . 6
- /exxxx . . . . . . . . . . . . . . . . . . . . . . . . 6
- /d99999. . . . . . . . . . . . . . . . . . . . . . . . 6
- /b . . . . . . . . . . . . . . . . . . . . . . . . . . 6
- /c . . . . . . . . . . . . . . . . . . . . . . . . . . 7
- /g . . . . . . . . . . . . . . . . . . . . . . . . . . 7
- /n . . . . . . . . . . . . . . . . . . . . . . . . . . 7
- /t . . . . . . . . . . . . . . . . . . . . . . . . . . 7
- /z . . . . . . . . . . . . . . . . . . . . . . . . . . 7
-
- CHAPTER 2 SPECIFYING INPUT OBJECT MODULES. . . . . . . . . . . . . 8
- Command Line Input . . . . . . . . . . . . . . . . . . 8
- Linker Response File Input . . . . . . . . . . . . . . 8
- Makefile Input . . . . . . . . . . . . . . . . . . . . 9
-
- CHAPTER 3 CREATING DECLARATION FILES . . . . . . . . . . . . . . . 11
- Non Parseable Object Module Information. . . . . . . . 11
- Comments in Declaration Files. . . . . . . . . . . . . 12
-
- CHAPTER 4 PARSEABLE OBJECT MODULES . . . . . . . . . . . . . . . . 13
-
- CHAPTER 5 PC_Opt OPTIMIZATIONS . . . . . . . . . . . . . . . . . . 20
- Far to Near Calling Conversion . . . . . . . . . . . . 20
- Register Passing Conversion. . . . . . . . . . . . . . 20
- Unreachable Procedure Deletion . . . . . . . . . . . . 20
- Stack Clearing Conversion. . . . . . . . . . . . . . . 20
- NOP Instruction Deletion . . . . . . . . . . . . . . . 21
-
- CHAPTER 6 THIRD PARTY OBJECT LIBRARIES . . . . . . . . . . . . . . 22
-
- CHAPTER 7 PROGRAM TESTING. . . . . . . . . . . . . . . . . . . . . 23
-
- CHAPTER 8 SAMPLE RUN . . . . . . . . . . . . . . . . . . . . . . . 24
-
- APPENDIX A ERROR MESSAGES . . . . . . . . . . . . . . . . . . . . . 26
-
- APPENDIX B COMMON QUESTIONS . . . . . . . . . . . . . . . . . . . . 38
-
- INDEX. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 40
- INTRODUCTION
-
- PC_Opt (Post Compile Optimizer) performs optimizations across all object
- modules before program linking is performed. These optimizations are
- based upon analysis of the complete program structure rather than a single
- module.
-
- PC_Opt analyzes program control flow hierarchy and consolidates code
- into segments where possible. Conversion of far call and return
- instructions to near call and return instructions is then performed.
- Conversion to register parameter passing is performed where possible.
- Also stack clearing conversion and non invoked code elimination is
- performed.
-
- All analysis and subsequent editing of code is performed on an object
- module level. The output from this process is also in the form of object
- module files. Additionally, a linker response file is generated which
- consists of a list of these output object files. The output object files can
- be linked by the programmer's usual linker in order to produce an
- executable file.
-
- This post compile form of optimization is possible only if the input object
- modules comply to a certain format or are specified otherwise as being
- non compliant. This manual describes this specification process to the
- extent that PC_Opt can be utilized with a minimum of effort.
-
-
- REQUIREMENTS
-
- PC_Opt runs under MS-DOS versions 3.0 and later. A minimum 512k of
- RAM memory is required. Additional memory is preferred when dealing
- with large size programs.
-
- This manual utilizes assembly language examples in order to describe
- PC_Opt functionality. The reader is assumed to possess a basic
- understanding of 80X86 assembly language concepts.
-
- GENERAL CAPABILITIES
-
- PC_Opt will read in and edit object files originating from C language
- source files and generated by Borland C++ 3.1 (C++ extensions not yet
- supported). It will also optimize any OMF standard object module that
- complies with the guidelines set forth in this manual to ensure correct
- object module interpretation (see chapter 4, PARSEABLE OBJECT
- FILES). Declaration files containing non parseable object module lists are
- also input to the program and utilized in optimization analysis (see chapter
- 3, CREATING DECLARATION FILES).
-
- Runtime declaration files are included on the distribution diskette. These
- files contain non parseable lists for each of the Borland runtime libraries
- (see DISTRIBUTION DISKETTE CONTENTS).
-
- PC_Opt operates on DOS applications only. Windows, OS/2 and 32 bit
- applications are currently not supported.
-
- DISTRIBUTION DISKETTE CONTENTS
-
- The distribution diskette contains the following files:
-
- BM.dat Borland Medium Model runtime declaration
- file
- BL.dat Borland Large Model runtime declaration
- file
- BH.dat Borland Huge Model runtime declaration file
-
- opt.exe PC_Opt executable
- read.me Additions to user manual and reference
- guide
-
-
- STEP BY STEP OPERATION
-
- The following is a brief description of the steps necessary to run PC_Opt
- on a large code model application. An sample run detailing these steps can
- be found in chapter 9, SAMPLE RUN.
-
- 1. Compile all code to be linked into the application.
-
- 2. Select the correct runtime declaration file for the language model
- used.
-
- 3. Create an application declaration file corresponding to the
- application object code. This step is not required if the /g
- command line option is specified.
-
- 4. Run PC_Opt with the results generated from steps 1, 2, and 3
- serving as input.
-
- 5. Link the object files created in step 4 in order to create the final
- executable file.CHAPTER 1 COMMAND LINE OPTIONS
-
- PC_Opt's command line has the following syntax:
-
- opt [/options] [object files], [library files]
-
- where:
-
- opt - invokes PC_Opt.
-
- options - the following are descriptions of the command line options
- available for PC_Opt:
-
- /axxxx Application declaration filename. Specifies the application
- declaration file to be read by PC_Opt. This file contains a
- list of non parseable object modules and libraries
- corresponding to the application object code. This option
- defaults to the filename OPT.DAT. This file is not required
- if the /g command line option is present.
-
- Example:
-
- opt /c /amcd.dat obj1 obj2 obj3
-
- This example will read from the application declaration file
- mcd.dat.
-
- /rxxxx Runtime declaration filename. Specifies the runtime
- declaration file. This file contains a list of non parseable
- object modules and libraries corresponding to the
- compiler's runtime object libraries for a particular language
- model. This option defaults to the filename ROPT.DAT
-
- Example:
-
- opt /rbl.dat /c obj1 obj2 obj3, lib1
-
- This example uses the Borland large memory model
- runtime declaration file as input. This file is supplied on
- the distribution diskette (see DISTRIBUTION DISKETTE
- CONTENTS).
-
- Note that the /a option is absent from this command line.
- This means that the application declaration filename will
- default to OPT.DAT.
-
- /oxxxx Output object file root name. Specifies the first letters of
- the output object files. Output object file names are
- constructed from up to four alphanumeric characters
- followed by a numbered sequence. If this option is not
- specified then the output object file name defaults to OPT.
-
- Example:
-
- opt /c /oarc obj1 obj2 ... objn
-
- The above command line argument will produce the
- following n output files:
-
- arc1.obj arc2.obj ... arcn.obj
-
- /sxxxx segment root name. Specifies the first characters of the
- names of the code segment(s) that are created by PC_Opt.
- New segment names are constructed from up to five
- alphanumeric characters followed by a numbered sequence.
- This option defaults to OPT.
-
- Example:
-
- opt /sNEWSEG /c obj1 obj2 obj3 obj4 obj5
-
- This example will assign n newly created segments in the
- output object files the names NEWSE1, NEWSE2, ..,
- NEWSEn. Note that the 'G' is truncated due to the five
- character limit.
-
- /lxxxx Output linker response file. Specifies the name of the linker
- response file to be generated by PC_Opt. This file contains
- a list of all output object file names and can be used as a
- response file for the subsequent link. If this option is not
- specified then the default output linker response file name
- OPT.LRF is assigned.
-
- Example:
-
- opt /c obj1 obj2 ... objn
-
- The above command line argument does not specify an
- output link response file so the default output linker
- response file OPT.LRF is created which contains a list of
- the following n output files:
-
- opt1.obj opt2.obj ... optn.obj
-
- This file can be used as an input link response file for the
- subsequent link.
-
- /mxxxx Makefile name. Specifies the name of the makefile that is
- to be searched in order to locate the link command line that
- contains the input object files and libraries. If the /e option
- is present and no makefile name is specified then this
- option defaults to the makefile name makefile.mak
-
- /exxxx Executable filename. Specifies the name of the executable
- filename that is to be searched for in the input makefile in
- order to retrieve the input object files and object libraries.
- The executable filename is expected to precede a make
- dependency list (see Makefile Input).
-
- Example:
-
- opt /c /mconstruc.mak /edsort.exe
-
- This example specifies that the input object files and object
- libraries are to be found on the link command line
- following the dsort.exe make dependency list in the make
- file named construc.mak.
-
- /d99999 Maximum consolidated segment size. Sets the maximum
- size for consolidated segments. This defaults to 65535 the
- maximum addressable segment size.
-
- /b Disable stack clearing conversion. This option turns off the
- conversion of stack clearing instructions from the C
- language to Pascal convention (see Stack Clearing
- Conversion).
-
- /c Case sensitive public symbols. This option tells PC_Opt to
- treat all public symbol names as case sensitive. This option
- is required when dealing with C language object files
- because all symbols in the C language are defined to be
- case sensitive.
-
- /g Edit supported compiler code only. This option allows
- PC_Opt to be run without creating application declaration
- files. Only object modules that were generated by a
- supported compiler (Borland) are considered parseable
- when this option is specified. PC_Opt will consider any
- non supported compiler generated code to be non parseable
- instead of reading in a non parseable list.
-
- /n No default library search. This option tells PC_Opt to
- ignore the default object libraries specified in object
- modules.
-
- /t Generate edited code size report. This option will generate
- a report containing the input and output code segment sizes
- of all parseable object modules.
-
- /z Allow zero opcode instruction. This option allows the
- existence of the add [bx+si],al machine instruction. This
- instruction is composed of two bytes containing values of
- zero. Detection of this instruction usually indicates
- immediate data within a code segment. By default, PC_Opt
- does not allow this instruction in parseable object modules.
- A fatal error occurs upon discovery of its existence. If this
- option is enabled then a warning message is displayed
- instead of a fatal error message.
- CHAPTER 2 SPECIFYING INPUT OBJECT MODULES
-
- PC_Opt retrieves object files and object library files as input. There are
- three methods for specifying these files:
-
- By entering object files and libraries directly on the command line
-
- By including a link response file on the command line
-
- By specifying a link command line within a makefile
-
- Command Line Input
-
- The list of object files and object libraries may be entered directly on the
- command line (after all options are entered). A comma must separate the
- last object file and the first object library file.
-
- Example:
-
- opt /c obj1 obj2 obj3, lib1 lib2
-
- This example specifies that three object files along with two object library
- files are to serve as input to PC_Opt.
-
- Linker Response File Input
-
- A linker response file that contains the list of input object files and object
- libraries may be included on the command line. A response file is denoted
- on the command line by preceding the filename with the '@' character.
- This response file must follow all options on the command line. The
- syntax of the contents of this response file is similar to that of the input
- to Microsoft's or Borland's linker:
-
- objfiles, [exefile], [mapfile], [libfiles]
-
- PC_Opt accepts this syntax format so that a single response file may be
- used as both input to the user's linker and to PC_Opt itself. NOTE: This
- syntax differs from the normal syntax of command line input (see above)
- in that additional commas are necessary to delineate the exefile and
- mapfile.
-
- Example:
-
- opt /c obj1 obj2 obj3 obj4, lib1 lib2 lib3
-
- This command line input example can be similarly entered as input from
- a linker response file:
-
- opt /c @linkinp.lrf
-
- Where the contents of the file LINKINP.LRF are:
-
- obj1 obj2 obj3 obj4,,, lib1 lib2 lib3
-
- Note the additional two commas inserted to delineate the exefile and
- mapfile.
-
- Makefile Input
-
- A makefile and executable filename may be specified on the command line
- so that input object files and object libraries may be extracted off of a link
- command line in an existing makefile. The executable filename must
- appear explicitly in the makefile (implicit make dependency lines are
- currently not supported). Also, macro definitions and makefile directives
- are ignored by PC_Opt. The following algorithm describes exactly how
- the input object file list is located in a makefile:
-
- The makefile is searched from top to bottom for the first
- occurrence of the specified executable filename found starting in
- column one. This filename must be followed by a colon according
- to make syntax rules. All items that follow this colon are
- considered to be elements in a make dependency list. All filenames
- in the make dependency list are parsed and the end of list is
- located. This dependency list may carry over across multiple lines
- by the existence of a backslash continuation character '\' at the end
- of a line. The next non blank line is then located. This line is
- interpreted as the link command line for the executable filename.
- This line should be indented according to make syntax rules so a
- blank or tab character is checked for in column one. The link
- command and all link parameter flags are parsed over. The next
- item encountered on the line is considered to be the start of the
- input object file list. A link response file may appear at any point
- after the link command on this line. A response file is denoted by
- preceding the filename with the '@' character.
-
- Example:
-
- opt /c /mstart.mak /estart.exe
-
- The above example specifies that the filename start.exe is to be searched
- for in the makefile start.mak.
-
- Contents of start.make:
-
- start.exe : startup.obj diff.obj edit.obj comp.obj
- link @link.lrf
-
- startup.obj: startup.asm startup.inc
- tasm startup.asm
-
- diff.obj: diff.c comp.h
- bcc -ml -C -c diff.c
-
- edit.obj: edit.c edit.h
- bcc -ml -C -c edit.c
-
- comp.obj: comp.c
- bcc -ml -C -c comp.c
-
- start.exe is found in the first column of line one followed by a colon and
- dependency list. The end of the dependency list is located and an indented
- link command line follows. After parsing over the link command the
- response file LINK.LRF is found and opened for further parsing.
-
- The contents of LINK.LRF:
-
- /m /l startup diff edit comp, start, start, +
- lib1 lib2 lib3 lib4
-
- The link parameters /m /l are parsed over and startup, diff, edit and comp
- are loaded as input object files. the executable filename (start.exe) and
- map filename (start.map) specifications are skipped over and lib1, lib2
- ,lib3 and lib4 are loaded as input object library files. Note the link
- response file continuation character '+' is different than the backslash
- continuation character '\' used in makefiles and may vary for different
- linkers.CHAPTER 3 CREATING DECLARATION FILES
-
- Declaration files serve as input to PC_Opt and contain a list of non
- parseable object module and library information used by PC_Opt during
- the optimization analysis phase. It is important that this non parseable
- information be correct in order to preserve output program integrity.
-
- Declaration files for the specific compiler language model runtime
- libraries are provided on the distribution diskette. The runtime declaration
- file is specified with the /r command line option (see chapter 1,
- COMMAND LINE OPTIONS).
-
- An application declaration file must be created if the /g command line
- parameter is not issued. This file contains the list of non parseable object
- modules and libraries which corresponds to the application object code.
- This declaration file must be maintained as modifications to the application
- occur. The application declaration filename is specified with the /a
- command line option (see chapter 1, COMMAND LINE OPTIONS).
-
- Non Parseable Object Module Information
-
- Object modules must comply to certain rules in order to be correctly
- interpreted and edited by PC_Opt. If an object module does not adhere to
- these rules it is considered to be non parseable. No instruction parsing or
- editing is performed on non parseable object modules.
-
- Object modules that are generated by supported compilers are considered
- to be compliant with parseable guidelines. Non supported compiler and
- assembler generated object modules must be inspected in order to
- determine if they are compliant and therefore considered parseable. These
- guidelines for determining whether or not an object module is parseable
- are described in chapter 4, PARSEABLE OBJECT MODULES.
-
- Non Parseable Object Module Libraries
-
- If an object module library is included in a non parseable list then all
- object modules within that library that have not been generated by a
- supported compiler will be considered non parseable. Object modules
- within a library may also be listed separately in a non parseable list.
-
- The format for non parseable object module or library listings in a
- declaration file is as follows:
- Each file must be on a separate line and include an obj or lib file
- extension so that PC_Opt can determine if an object module or library is
- being listed.
-
- The following is the contents of an application declaration file where 4
- object modules and one object module library are declared as non
- parseable.
-
- Example:
-
- MEM.OBJ
- DISKIO.OBJ
- QSORT.OBJ
- LINE32.OBJ
- GRAFIT.LIB
-
- Comments in Declaration Files
-
- Comment lines are permitted in declaration files as long as they are
- preceded by a semicolon ';' character. Comments can be used to explain
- why a particular object module is considered to be non parseable.
- CHAPTER 4 PARSEABLE OBJECT MODULES
-
- As stated previously, object modules must comply with certain rules in
- order to be correctly interpreted and edited by PC_Opt. If an object
- module does not adhere to these rules it is considered to be non parseable
- and will require a non parseable declaration. Object modules that are
- generated by supported compilers are parseable due to the standard format
- of supported compiler generated object code. The non parseable
- restrictions detailed here are generally related to more obscure coding
- practices that would not be found in compiler output code.
-
- The following is a listing of properties that are required of an object
- module in order for it to be considered parseable:
-
- - standard stack frame parameter accessing
-
- The standard stack frame parameter accessing method must be used in
- order to retrieve procedure input parameters off of the stack. This method
- of stack based parameter accessing is employed in all compiler generated
- object code. Register parameter passing conventions are not affected by
- this restriction. The standard stack frame parameter accessing method is
- described as follows:
-
- The bp register is set to the value of the stack pointer register sp and stack
- based input parameters are accessed in a [bp + positive displacement]
- indexed addressing mode.
-
- Example:
-
- _abc proc far
- push bp
- mov bp,sp
- ___
- ___
- mov al,byte ptr [bp+6] ; get input byte
- ___
- ___
- pop bp
- retf
- _abc endp
-
- In procedure _abc the stack frame is set by first saving the contents of the
- bp register with the push bp instruction and then assigning the value of
- sp to bp with the mov bp,sp instruction. The input byte parameter is then
- accessed off of the stack with the mov al,byte ptr [bp+6] instruction.
- Finally, the contents of the bp register are restored with the push bp
- instruction. This example illustrates standard stack frame accessing.
-
- Example:
-
- _xyz proc far
- cmp byte ptr _value,0
- jnz noinc
- cmp ax,0
- jnz noinc
- inc byte ptr _value
- noinc:
- retf
- _xyz endp
-
- In procedure _xyz there is no stack based parameter accessing performed
- so no standard stack frame setup instructions are required. This procedure
- is would not require a non parseable declaration for the object module in
- which it resides because there is no non standard stack based parameter
- accessing present.
-
- Example:
-
- _zyx proc near
- pop cx
- pop ax
- cmp ax,0
- jnz noinc
- inc ax
- noinc:
- push cx
- push cx
- ret
- _zyx endp
-
- Procedure _zyx accepts an input stack based word parameter and returns
- the word value or 1 if the word value is zero. The pop cx instruction
- increments the stack pointer so that it points to the input word on the
- stack. In doing this the procedure return address is stored in the cx
- register. The pop ax instruction retrieves the input word off of the stack
- into the ax register. The last two push cx instructions set the stack pointer
- back to its original value and also store the procedure return address from
- cx back into its proper location on the stack. This procedure illustrates a
- non standard stack frame method of accessing parameters off of the stack.
- This procedure would require that a non parseable object module
- declaration be created for the object module in which it resides.
-
- As a corollary, any indexed addressing instructions which utilize the bp
- register and a positive displacement must be used only in accessing the
- parameters off of the stack. No use of the bp register to access items in
- the data segment (in the case where ss equals ds) is permitted in parseable
- object modules.
-
- - no non relocatable immediate data in code segments
-
- PC_Opt attempts to detect non relocatable immediate data inside parseable
- code segments and issues a fatal error upon finding any. It is possible,
- however, for an occurrence of non relocatable immediate data to go
- undetected. This would result in an incorrect machine code interpretation.
- PC_Opt requires all object modules that contain code segment non
- relocatable immediate data to be declared as non parseable. This
- requirement eliminates the possibility of incorrect machine code
- interpretation.
-
- The exception to this requirement involves immediate comparison data
- within code generated by a C language switch statement. PC_Opt is able
- to recognize switch statement immediate data in supported compiler object
- code. This allows all supported compiler generated code to remain
- parseable.
-
- Supported compiler generated object code will not include any non
- relocatable immediate data within code segments.
-
- Example:
-
- _msg proc far
- push bp
- mov bp,sp
- jmp overmsg
- msgaddr:
- db 'dept of redundancy dept'
- overmsg:
- push cs
- push offset msgaddr
- call far ptr _displaymsg
- pop cx
- pop cx
- pop bp
- retf
- _msg endp
-
- Procedure _msg contains non relocatable immediate data at the location
- msgaddr and therefore the object module that contains this procedure
- should be declared as non parseable.
-
- Example:
-
- _msg2 proc far
- push bp
- mov bp,sp
- jmp overaddr
- addr:
- dw offset _msg2
- overaddr:
-
- ---
- ---
- pop bp
- retf
- _msg2 endp
-
- Procedure _msg2 contains relocatable immediate data at the location addr.
- This data is considered to be relocatable because the value of offset
- _msg2 is relative to the address of the relocatable segment in which the
- procedure _msg2 lies. Relocatable data is explicitly defined in an object
- module and will not be mistakenly interpreted as machine instructions.
- Relocatable code segment data does not require a non parseable
- declaration for the object module in which it resides. It is possible to
- determine if code segment data is relocatable by inspecting the assembler
- output list file. This file includes relocatable information in the machine
- code portion of the listing.
-
- - no non contiguous instruction addresses in code segment
-
- The occurrence of a non contiguous instruction address in a parseable
- object module will cause PC_Opt to terminate execution. The use of the
- assembly language ORG pseudo op in a code segment, for example, will
- generate a non contiguous instruction address. This pseudo op causes the
- next instruction to begin at the address specified rather than at the address
- following the previous instruction. All object modules that contain a non
- contiguous instruction address must be declared as non parseable.
-
- Example:
-
- _nearp proc near
- push bp
- mov bp,sp
- ---
- ---
- pop bp
-
- retf
- ORG $ - 1
- ret
- _nearp endp
-
- Procedure _nearp contains an ORG statement that sets the next instruction
- to begin before the previous retf instruction. This overwrites the far return
- instruction with the subsequent near return instruction.
-
- This non contiguous addressing is not supported by PC_Opt and will
- terminate execution unless the object module that contains procedure
- _nearp is declared as non parseable.
-
- - protected mode and 32 bit instructions not supported
-
- Protected mode instructions and 32 bit instructions are currently not
- supported in parseable object modules. These instructions will cause a
- "immediate data found in code segment" fatal error. All object modules
- that contain these type of instructions must be declared as non parseable.
-
- - non standard call and return operations
-
- Any substitution of a return or call instruction by its equivalent series of
- jump operations in an object module would require a non parseable
- declaration for that object module. The following two examples illustrate
- this type of substitution.
-
- Example:
-
- A1: dw ?
- _jumpret proc near
- pop cs:A1
- ---
- ---
- jmp word ptr cs:A1
- _jumpret endp
-
- In the previous example the procedure return address is popped off of the
- stack and stored in the variable A1. The last instruction in the procedure
- transfers control back to the procedure return address through the A1
- variable. This illustrates a method of substituting a return statement with
- an indirect jump.
-
- Example:
-
- _proca proc far
- push bp
- mov bp,sp
- ___
- ___
- pop bp
- retf
- _proca endp
-
- _jumpcall
- proc far
- push bp
- mov bp,sp
- ---
- ---
- push cs
- mov ax,offset pastcall
- push ax
- jmp near ptr _proca
- pastcall:
- ___
- ___
- pop bp
- retf
- _jumpcall endp
-
- In this example procedure _jumpcall contains a series of instructions
- leading up to a transfer of control to _proca. These instructions perform
- the same operations as a single call instruction. The push cs and push ax
- instructions store the return segment and offset address on the stack. The
- jump to _proca will then result in a return of control to the address of the
- following instruction. This illustrates an example of substituting a call
- statement with a direct jump.
-
- The previous examples are certainly not representative of commonplace
- coding techniques but nonetheless illustrate restrictions placed upon
- parseable object modules.CHAPTER 5 PC_Opt OPTIMIZATIONS
-
- This section describes the various optimizations performed by PC_Opt.
- The stack clearing and register passing conversions may be disabled by
- command line options.
-
- Far to Near Calling Conversion
-
- The entire program calling hierarchy is analyzed and far call and return
- instructions are converted to their near counterparts if possible. This
- involves creating new code segments that contain the calling and called
- code. The contents of these new segments can be inspected by viewing the
- output map file from the subsequent link. This conversion produces
- smaller and more efficient executable code.
-
- Register Passing Conversion
-
- Stack based procedure parameters can be converted to register parameters
- in some instances. This conversion will result in a reduction in the number
- of memory accesses performed during program execution.
-
- Unreachable Procedure Deletion
-
- Object modules may contain procedures that are not accessed by any
- calling code. Normally these non accessed procedures would be linked
- into the final executable file even though they are never invoked. PC_Opt
- determines which procedures are not accessed and deletes them from the
- output object module. This deletion produces a reduced executable code
- size.
-
- Stack Clearing Conversion
-
- In allowing for a variable number of arguments to be passed into a
- function, the C language definition necessitates that object code be
- generated in compliance with the C language calling convention.
-
- This convention requires that the calling code is to perform all parameter
- stack clearing operations after return of control from the called function.
- Calling code parameter stack clearing requires additional instructions when
- compared to called procedure parameter stack clearing. Called procedure
- parameter stack clearing is sometimes referred to as the pascal stack
- clearing convention. PC_Opt converts object code to the shorter called
- procedure stack clearing format wherever possible. This conversion results
- in smaller and more efficient executable code.
-
- NOP Instruction Deletion
-
- The nop instruction is usually inserted by compilers to replace the last
- byte in a 3 byte jump instruction when the compiler is able to convert the
- jump to a jump short instruction. In some cases this instruction is placed
- into object code as filler in order to allow destination addresses to fall on
- even code boundaries.
-
-
- This even destination alignment offers a slight improvement in execution
- speed over non aligned code. Unfortunately PC_Opt does not contain any
- even code alignment capabilities. Because of this, all nop instructions are
- removed from edited code due to the fact that their edited alignment may
- have been altered to an odd code address.
- CHAPTER 6 THIRD PARTY OBJECT LIBRARIES
-
- If third party object modules or libraries are included as input to PC_Opt
- then their accompanying non parseable lists must also be included. If these
- lists cannot be obtained then the object module or library must be declared
- as non parseable. In most cases the third party object module or library
- will have to be declared as non parseable because information on the on
- the nature of its code will be difficult to obtain.
-
- If an object library file is declared as non parseable then only the code not
- generated by a supported compiler is considered non parseable. PC_Opt
- will edit supported compiler generated code in a non parseable object
- library.
- CHAPTER 7 PROGRAM TESTING
-
- Extensive program testing should be performed after linking the output
- object files into a final executable file. All possible paths of a program
- should be explored in order to confirm reliability of the final product.
- Most problems will arise as a result of a non parseable object module
- declaration being omitted. If any of omission of this type were to occur
- then it would be possible for the resultant output program to hang.
-
- Full symbolic debugging information, unfortunately, is not included
- PC_Opt output object files. Public symbol debug information can be
- accessed through Borland's debugger if the /v option is enabled during
- linking of the PC_Opt output object files. These symbols can be accessed
- by using the goto address command in the debugger's CPU window.
-
- The following are additional program testing tips:
-
- If the final executable code had worked previously and fails after
- modifications have been made to the program, attempt to determine if the
- specific changes made have any affect on the corresponding declaration
- files. It is easy to forget to perform the necessary modifications on the
- declaration files after modifying the source code.
-
- Run PC_Opt with stack clearing disabled and or register passing disabled
- and check if the problem is still present. If the program then executes
- correctly then the problem can be narrowed down to a certain operation
- being performed on the object code.
-
- Run PC_Opt with the /g option if the problem persists. This will prevent
- the altering of any object module that was not generated by a supported
- compiler. If this solves the problem then the original problem is a result
- of failing to declare object module(s) as non parseable. CHAPTER 8 SAMPLE RUN
-
- A sample run is described here in order to illustrate the basic steps
- involved in using PC_Opt. The majority of the preparation effort involves
- creating the correct application declaration file for the project to be
- processed.
-
- A large code model program is composed of twenty-eight object files, two
- runtime object library files and a third party screen i/o object library file.
- Three of the input object files are assembler generated. The others,
- originating from C language source code, have been generated by
- Borland's C++ compiler.
-
- Since the linker will be accepting the Borland large model runtime
- libraries as input, the corresponding runtime declaration file, bl.dat, is
- selected for use with PC_Opt (see DISTRIBUTION DISKETTE
- CONTENTS). This file contains all of the necessary non parseable
- listings for the Borland large program model runtime libraries. This file
- is specified with the /r command line option.
-
- The next step is to create the application declaration file. This file is to
- contain non parseable information corresponding to the twenty-eight
- application object files and the third party object library file.
-
- One of the assembly language source files is found to contain non
- relocatable immediate data within a code segment. Code segment non
- relocatable immediate data requires a non parseable declaration for the
- object module in which it is located. The assembly source file name that
- contains this data is append.asm so the application declaration file opt.dat
- is created containing append.obj comprising its non parseable list.
-
- The third party object library vendor is unable to furnish all of the details
- about non parseable object modules within the screen i/o library file.
- Because of this, the entire library file scrio.lib is declared as non
- parseable.
-
- scrio.lib is inserted into non parseable list in the application declaration
- file opt.dat.
-
- Declaration file creation is now completed and the next step is to specify
- the input object files and object library files in order run PC_Opt. A link
- response file, enet.lrf, has already been set up that contains a list of these
- files. PC_Opt is invoked using the following command line:
-
- opt /rbl.dat @enet.lrf
-
- This command line specifies for PC_Opt to be run using the Borland large
- model runtime declaration file and the default application declaration file
- opt.dat.
-
- PC_Opt processing is initiated and execution completes successfully. The
- program generates an object file for each object module that is to be
- linked into the final executable file. A link response file, OPT.LRF, is
- also created that contains a list of these output object filenames. The
- Borland linker, tlink, is invoked with the following command line in order
- to produce the final executable file:
-
- tlink @opt.lrf
-
- This will produce the desired ouput executable file.APPENDIX A ERROR MESSAGES
-
- 201 end of file not expected - filename XXXXXXXX
- An end of file condition has been detected and additional expected
- items have not been read.
-
- 202 io error reading/writing file XXXXXXXX
- An IO error occurred while reading or writing a file.
-
- 203 exe extension expected on executable filename XXXXXXXX
- A file extension other than exe was found on the input executable
- filename. This filename is searched for in the specified makefile
- in order to obtain the list of input object files.
-
- 204 colon expected after executable filename XXXXXXXX in
- makefile XXXXXXXX
- An executable filename was found in column 1 in a makefile but
- no following colon has been encountered. (see makefile input for
- further explanation).
-
- 205 executable filename XXXXXXXX not found in makefile
- XXXXXXXX
- The executable filename was not found during makefile search.
- NOTE: The executable filename must start in column 1 to be
- interpreted as being dependant on following list of object files
- (thus only column 1 is searched) make sure the executable
- filename starts in column 1 (see makefile input for further
- explanation).
-
- 206 no link command found for executable filename XXXXXXXX
- in makefile XXXXXXXX
- The next line in the makefile was expected to be a link command
- line for the executable filename but was not found to be indented
- so it cannot be interpreted as a link command line (see makefile
- input for a further explanation).
-
- 207 no dependency object files or libraries found on link command
- line for executable file XXXXXXXX in makefile XXXXXXXX
- The link command was found for the input executable filename but
- no list of object files or object libraries were found following the
- link command and link parameter flags.
-
- 208 file XXXXXXXX not found
- The file to be opened was not found.
-
- 209 io error opening file XXXXXXXX
- An IO error occurred while attempting to open a file
-
- 210 end of object module XXXXXXXX not expected
- An end of file condition occurred and additional object module
- data was expected.
-
-
- 211 application declaration file specified and /g option enabled
- An application declaration filename was specified on the command
- line and the /g option was also enabled. The /g command line
- option specifies that the application declaration file is to be
- ignored.
-
- 221 obj or lib extension expected in filename XXXXXXXX in
- declaration file XXXXXXXX
- A filename was found in a declaration file but no .lib or .obj file
- extension was present.
-
- 240 pathname too long for file XXXXXXXX
- A pathname for an input file exceeds the dos maximum allowable
- pathname length.
-
- 241 object file XXXXXXXX must have an OBJ extension
- An input object file was found to have a file extension other than
- .OBJ.
-
- 242 object library file XXXXXXXX must have an LIB extension
- An input object library file was found to have a file extension
- other than .LIB.
-
- 243 bad record type X found in object module XXXXXXXX at
- offset 99999
- An unknown object module record type was encountered in an
- object module. This error usually indicates a damaged object
- module.
-
- 244 segment name not found in object module XXXXXXXX
- The segment, segment class, or segment overlay name cannot be
- found in an object module. This error indicates a damaged object
- module.
-
- 245 illegal group component type X in object module XXXXXXXX
- The group component byte in a group definition record in an
- object module is not the required 0xFF value. This error indicates
- a damaged or unsupported type object module.
-
- 246 group segment not found in object module XXXXXXXX
- A segment index that is part of a group definition has no matching
- segment definition in an object module. This error indicates a
- damaged object module.
-
- 247 group name not found in object module XXXXXXXX
- A name index that is part of a group definition has no matching
- name definition in an object module. This error indicates a
- damaged object module.
-
- 248 data segment not found in object module XXXXXXXX
- A segment index that is part of a data record has no matching
- segment definition in an object module. This error indicates a
- damaged object module. This also may indicate a C++ language
- object module.
-
- 249 iterated data found in code segment in object module
- XXXXXXXX
- Iterated data was found in a code segment. This prevents
- successful instruction parsing of the object module. This object
- module must be declared as non parseable using the in a
- declaration file.
-
- 250 80386 record found in object module XXXXXXXX not
- supported
- An 80386 object module record was found. 80386 object modules
- are presently not supported.
-
- 251 BAKPAT fixup record found in object module XXXXXXXX
- not supported
- A Quick C BAKPAT fixup object module record was found. This
- type of fixup record is used for single pass compiling and is
- currently not supported.
-
- 252 MSC 7.0 object file record type X found in object module
- XXXXXXXX not supported
- A Microsoft C version 7.0 object module record was found. The
- current version of PC_Opt does not support this record type.
-
- 253 invalid library header record found in object library
- XXXXXXXX
- The expected library header record (record type 0xF0) was not
- found at the beginning of a object library file. This indicates a
- damaged object library file.
-
- 254 duplicate public XXXXXXXX found in object library
- XXXXXXXX
- A public symbol was found more than once in an object library
- dictionary. This indicates a damaged object library file.
-
- 255 object module header not found in library XXXXXXXX for
- public symbol XXXXXXXX
- The expected object module header record (record type 0x80) was
- not found at the beginning of a object module in an object library
- file. This indicates a damaged object library file.
-
- 256 unresolved external reference XXXXXXXX
- An external symbol was found with no matching public symbol
- present in any of the input object or object library files.
-
- 257 fixup location exceeds code segment size in object module
- XXXXXXXX
- A fixup location extends beyond the end of code segment data in
- an object module. This usually indicates a damaged object module.
-
- 258 fixup destination exceeds code segment size in object module
- XXXXXXXX
- A fixup destination extends beyond the end of code segment data
- in an object module. This usually indicates a damaged object
- module.
-
- 259 immediate data found in code segment in object module
- XXXXXXXX
- Immediate data was found while parsing instructions in a code
- segment. Object modules that contain immediate data in code
- segments must be declared as non parseable using the -N
- parameter.
-
- 260 fixup external index 99 not found in object module
- XXXXXXXX
- An external index derived from a fixup record has no matching
- external symbol in an object module. This is an indication of a
- damaged object module.
-
- 261 group based fixup target in code segment in object module
- XXXXXXXX
- A fixup target that refers to a location in a code segment is found
- to be an offset to a group of segments rather than a single
- segment. This mode of target referencing is not supported.
-
- 262 absolute displacement exceeds segment size in object module
- XXXXXXXX
- A non fixup displacement refers to a destination beyond the end of
- a code segment. This is usually an indication of a damaged object
- module.
-
- 263 fixup not found on second pass in object module XXXXXXXX
- A fixup table has been corrupted between first and second pass of
- instruction parsing. This is a diagnostic error and will be removed
- upon completion of beta testing.
-
- 264 fixup target segment 99 not found in object module
- XXXXXXXX
- A segment index derived from a fixup record has no matching
- segment record in an object module. This is an indication of a
- damaged object module.
-
- 265 absolute intersegment addressing in object module
- XXXXXXXX
- No matching fixup can be found for an intersegment address. This
- usually is an indication of a damaged object module.
-
- 266 public XXXXXXXX offset exceeds size of segment in object
- module XXXXXXXX segment index 9999 offset 99999
- A public symbol has been found in a segment but has an offset that
- exceeds the size of that segment. This is an indication of a
- damaged object module.
-
- 267 non contiguous data in code segment found in object module
- XXXXXXXX not supported
- A code segment was found to contain non contiguous data. This
- condition occurs for instance when an ORG statement in assembly
- language sets an instruction address to a designated value. An
- object module that contains non contiguous data in a code segment
- must be defined as non parseable.
-
- 268 code segment data record exceeds segment length in object
- module XXXXXXXX
- A code segment data record was found that exceeds the size listed
- in the corresponding segment record. This indicates a damaged
- object module.
-
- 269 list locked when not in use in object module XXXXXXXX
- A list that has been processed has not been unlocked. This is an
- internal paging error.
-
- 270 fixup references code segment comdef symbol XXXXXXXX in
- object module XXXXXXXX
- A direct transfer external fixup found in a code segment refers to
- a common type symbol. Code segment common symbols are not
- supported in direct transfer instructions.
-
- 271 inconsistent results derived while consolidating code
- Errors occurred while analyzing procedure relationships. This
- error indicates a discrepancy between optimization analysis results
- between related procedures.
-
- 272 multiple program starting addresses found in object modules
- XXXXXXXX and XXXXXXXX
- More than 1 program starting address was found in input object
- modules.
-
- 273 no program starting address found in object modules
- No program starting address was found in the input object
- modules.
-
- 274 far call found in object module XXXXXXXX offset 99999 calls
- near procedure in object module XXXXXXXX offset 99999
- A far call (either call far ptr or push cs, call near ptr) calls a
- procedure that contains a terminating near return instruction. If this
- non conventional call is intentional then the object module that
- contains either the calling procedure or the called procedure must
- be declared as non parseable in order for PC_Opt processing
- complete successfully.
-
- 275 near call found in object module XXXXXXXX offset 99999
- calls far procedure in object module XXXXXXXX offset 99999
- A near call (call near ptr) calls a procedure that contains a
- terminating far return instruction. If this non conventional call is
- intentional then the object module that contains either the calling
- procedure or the called procedure must be declared as non
- parseable in order for PC_Opt processing complete successfully.
-
- This error might be the result of a far call instruction sequence
- consisting of a push cs, near call in which the push cs instruction
- does not immediately precede the call instruction. EXAMPLE -
- The following call to procedure _wayfar is meant to be a far call
- consisting of a push cs and near call instruction sequence. The call
- is not recognized as a far call because the push cs instruction does
- not immediately precede the call instruction:
-
- _TEXT segment byte public 'CODE'
- _wayfar proc far
- ___
- ___
- ___
- retf
- _wayfar endp
-
-
- _callwayfar proc far
- push bp
- mov bp,sp
- push si
- mov ax,word ptr[bp+6]
- ___
- ___
- push cs ; push cs for intra
- segment
- ; call to far proc
- mov si,ax ; save contents of ax
- in si
- ; across proc call
- call near ptr _wayfar
- mov ax,si ; retrieve contents of
- ax
- ___
- ___
- ___
- pop si
- pop bp
- retf
- _callwayfar endp
- _TEXT ends
-
- 276 external symbol XXXXXXXX referenced in object module
- XXXXXXXX not found in code segment in object module
- XXXXXXXX
- An external symbol that was expected to reference a code segment
- public symbol references a non code segment public symbol.
-
- 277 add byte ptr [bx+si],al instruction found in code segment in
- object module XXXXXXXX.
- add byte ptr [bx+si],al instruction was found during instruction
- parse. This instruction is composed of bytes 00 00 and is therefore
- suspected as being data rather than a true instruction. Use the /z
- command line parameter in order to allow this instruction to be
- parsed.
-
- 278 conditional transfer instruction found at end of code segment
- in object module XXXXXXXX
- A conditional transfer instruction was found to be the last opcode
- in a code segment. This is not allowed in parseable object
- modules.
-
- 280 hard disk paging error
- An IO error occurred while attempting to page data out to disk.
-
- 281 expanded memory paging error
- An IO error occurred while attempting to page data out to
- expanded memory.
-
- 282 invalid page address
- An attempt was made to page out or page in data from an
- uninitialized page address. This is a diagnostic error and will be
- removed after beta testing.
-
- 283 no more page memory available
- An attempt was made to page out data and no disk or expanded
- memory was available. Attempt to increase available disk space
- and rerun the program.
-
- 284 undefined paging status
- An unknown paging error occurred. This is an indication of
- internal error.
-
- 285 out of memory
- All of RAM memory has been used up and no more is available.
- Disable all TSR's, device drivers, network drivers, shells, etc. and
- attempt to rerun program.
-
- 286 internal memory block too large for object module
- XXXXXXXX
- An object module is too large to fit data into a memory block.
- Attempt to split the object module into separate smaller object
- modules and attempt to rerun program.
-
- 287 illegal maximum segment size 99999 specified on command line
- A maximum segment size was specified which exceeds 65535 or
- is less than 2000 bytes.
-
- 288 unrecognized command line argument XXXXXXXX
- A command line argument was found that is not recognized as a
- legal command line argument.
-
- 289 object files specified in makefile XXXXXXXX and on command
- line
- Command line input object files are specified along with makefile
- object module specification. Input object files cannot be specified
- in both a makefile and on the command line.
-
- 290 makefile specified but no executable file specified
- A makefile was specified on the command line but no
- accompanying executable file was specified.
-
- 293 executable string record found in object module XXXXXXXX
- not supported
- An executable string (EXESTR) record type was found in an
- object module. Executable string record types are currently not
- supported.
-
- 294 weak or lazy extern record found in object module
- XXXXXXXX not supported
- A weak or lazy extern record type was found in an object module.
- Weak or lazy extern record types are currently not supported.
-
- 295 windows record found in object module XXXXXXXX. windows
- processing not enabled
- A windows record type was found in an object module. Windows
- applications are currently not supported.
-
- 296 incremental compilation record found in object module
- XXXXXXXX not supported
- An incremental compilation (Quick C) record type was found in an
- object module. Quick C object modules are currently not
- supported.
-
- 297 bad checksum found in object module XXXXXXXX
- A bad checksum was found in an object module record. This
- indicates a damaged object module.
-
- 298 non floating point absolute data fixup found in code segment in
- object module XXXXXXXX
- Code generated by floating point operations may possibly contain
- absolute data fixups that provide for link time generation of
- floating point object code instructions. PC_Opt supports this code
- generation mechanism for floating point instructions only. All non
- floating point instruction generation of this type will generate this
- error message. If this error message occurs then the object module
- listed in the error message must be declared as non parseable. WARNING MESSAGES
-
- 201 cs override string instruction found in segment XXXXXXXX in
- object module XXXXXXXX
- A code segment override byte was found before a string instruction
- during instruction parsing. movs, cmps, scas, lods and stos are
- the five string instructions. cs override instructions prohibit the
- optimization of all procedures within a code segment.
-
- 202 cs override indexed memory access found in segment
- XXXXXXXX in object module XXXXXXXX
- A code segment override byte was found before an instruction that
- contains an indexed memory access. cs override instructions
- prohibit the optimization of procedures within a code segment.
-
- 203 duplicate object filename XXXXXXXX found
- An object filename appears more than once among the list of input
- object files.
-
- 204 duplicate library filename XXXXXXXX found
- An object library filename appears more than once among the list
- of input object library files.
-
- 205 both return statement and calling code clear stack for
- procedure number 99 segment XXXXXXXX in object module
- XXXXXXXX
- A procedure was found that contains a retn stack clearing return
- statement and calling code to that procedure was found to perform
- stack clearing operations also. This could be the result of
- compiling the called procedure with pascal type calling conventions
- and failing to do similarly when compiling the calling code.
-
- 206 procedure consolidation size calculation incorrect for object
- module XXXXXXXX segment number 9999 procedure offset
- 999999
- The size of a procedure calculated during segment consolidation
- analysis does not match the actual size of the procedure after
- object code editing.
-
- 207 8 bit displacement converted to 16 bit displacement
- An instruction that contains an 8 bit displacement was converted
- to an equivalent instruction sequence containing a 16 bit
- displacement.
-
- In certain instances, instruction bytes are added to object code after
- consolidating code into a segment. If these extra instruction bytes
- result in an 8 bit displacement adjustment exceeding 8 bit range
- limitations then the 8 bit displacement instruction is replaced by a
- logically equivalent instruction sequence containing a 16 bit
- displacement.
-
- 208 non parseable object module XXXXXXXX listed in declaration
- file not found
- An object module or object module library was found listed in the
- non parseable list of the application declaration file but is not
- found in any of the object modules to be included in the executable
- file. This warning message is intended to alert the user of possible
- inaccuracies in the application declaration file.APPENDIX B COMMON QUESTIONS
-
- preserving near calls
-
- How can it be ensured that a specified procedure or group of procedures
- will be consolidated so that they transfer control to each other by near
- calls and returns?
-
- The set of procedures must be setup as near in the original C or assembly
- source file. PC_Opt does not convert any near procedures to far
- procedures, so the intra segment relationship between the procedures will
- remain preserved.
-
- why no link
-
- Why doesn't PC_Opt additionally link the input object code in order to
- produce a final executable file?
-
- The overall purpose of PC_Opt is improve the quality of the object code
- prior to linking. All development efforts have been directed toward this
- purpose. Additional memory would be required in which to fit the linker
- code which might prohibit the processing of larger programming projects.
- Also, the user's normal full featured linker would in all probability
- possess features that could not be included in a back end PC_Opt link
- process.
-
- full declaration pathnames
-
- In what cases are full pathnames required for files listed in non parseable
- declarations?
-
- Full pathnames are required for all standalone object and object library
- files listed in non parseable listings. Pathnames must not present,
- however, for object module names that are contained within an object
- library file. All runtime declaration files contain the default installation
- pathnames for the supported compilers' runtime libraries (\borland\lib\).
- These declaration files must be altered in the event that the runtime
- libraries do not reside in the default pathname directories.
-
- examining segment contents
-
- How can the contents of the newly created code segments be examined?
-
- The link map file can be inspected in order to determine which public
- symbols have been consolidated into a segment. Use the /m map file
- option when invoking the Borland linker.
-
- program interruption
-
- Can PC_Opt processing be canceled prior to normal program termination?
-
- The user may cancel processing by pressing control-C. This will delete all
- page files on disk and/or release paging memory being used. If for some
- reason, processing is abnormally terminated by a system hang or power
- interruption then the chkdsk should be run in order to freeup all disk
- paging files. Run chkdsk with the /f option and delete the recovered
- clusters by issuing a del \*.chk command.
-
- INDEX
-
- 32 bit applications 2 org psuedo op 17
- 32 bit instructions 17 OS/2 2
- additional operations 20 parseable object modules 13
- command line options 4 pascal
- -axxxx 4 stack clearing 6, 20
- -b 6 protected mode 17
- -c 7 relocatable data 16
- -d99999 6 runtime declaration files 2
- -exxxx 6 standard stack frames 13
- -lxxxx 5 supported compilers 2
- -mxxxx 6 switch statement 15
- -n 7 system requirements 1
- -oxxxx 5 third party object libraries 22, 24
- -rxxxx 4 windows applications 2
- -sxxxx 5
- -t 7
- -z 7
- /g 7
- declaration file comments 12
- declaration files 2
- creating 11
- non parseable information 11
- diskette contents 2
- extended libraries 2
- immediate data 15
- input object modules
- command line input 8
- linker responsefile input 8
- makefile input 9
- specifying 8
- third party 2
- near call preservation 38
- non contiguous instructions 17
- non parseable declaration 11
- non standard calls 18
- non standard returns 18
- nop instruction 21
- optimizations
- calling conversion 20
- code deletion 20
- register passing 20
- stack clearing 20
-
-
-