|
Updated 8/27/08
There may be times when you want to modify the Irvine32 library, perhaps
to fix a bug, or to add your own functions. If you do that, your changes
will be overwritten the next time you download an updated copy of Irvine32.lib
from the book's Web site.
The Irvine32 library functions are located in two source files: Irvine32.asm,
and floatio.asm. Be sure to make a backup copy of any file you plan to
modify.
You will need to add two new entries to the Tools menu in Visual
C++ 2008 Express:
- The first, named Assemble 32-bit, will be used to assemble
the Irvine32.asm and floatio.asm files after you've modified tem. The
tool will produce the Irvine32.obj and floatio.obj files.
- The second tool, named Update Irvine32 Library, will replace
the existing code in the Irvine32.lib file with the new code you've
created. Then you can just copy the Irvine32.lib file into the c:\Irvine
folder and begin using it as usual.
Create the Assemble 32-bit Tool
Follow these steps to add the Assemble 32-bit tool to the Tools
menu.
- Select External Tools from the Tools menu
- In the External Tools dialog, click the Add button.
- Set the Title field to Assemble 32-bit.
- Click the browse button on the right side of the Command field and
navigate to the ML.EXE program on your computer. The path will probably
be C:\Program Files\Microsoft Visual Studio 9.0\VC\bin\ml.exe
- Insert the following in the Arguments field: -c $(ItemFileName).asm
- Insert the following in the Initial directory field: $(ItemDir)
- Uncheck the Close on exit checkbox.
- Click the OK button to save your tool.
Test the Assemble 32-bit Tool
- Using Visual C++ Express, open the Irvine32_Libary.sln file
from the C:\Irvine\examples\Lib32\Irvine32_Library folder.
- Open the Irvine32.asm file in the editor.
- Click the Save button to update the file.
- Select Assemble 32-bit from the Tools menu.
- Verify in Windows Explorer that Irvine32.asm and Irvine32.obj both
have a current date/time.
Create the Update Irvine32 Library Tool
Next, you will add an entry to the Tools menu that runs the LIB.EXE utility.
This program will insert the Irvine32.obj file into the Irvine32.lib file.
- Select External Tools from the Tools menu.
- Click the Add button in the External Tools dialog.
- Name the tool Update Irvine32 Library.
- In the Command field, navigate to the LIB.EXE file, usually
located in the C:\Program Files\Microsoft Visual Studio 9.0\VC\bin\ folder.
- Insert the following value in the Arguments field:
/subsystem:console Irvine32.obj floatio.obj
- Set the Initial directory field to $(ItemDir)
- Uncheck the Close on exit checkbox.
- Click the OK button to save your changes.
Test the Update Irvine32 Library Tool
Assuming the Irvine32_Libary.sln project file is still open, select
Update Irvine32 Library from the Tools menu. You should see the
following output in a Console window:

Replace the Irvine32.lib file
The last step is to copy your updated Irvine32.lib file to the c:\Irvine
folder. You might want to make a backup of the existing Irvine32.lib file
first!
|