Updating the Irvine32 Link Library

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.

  1. Select External Tools from the Tools menu
  2. In the External Tools dialog, click the Add button.
  3. Set the Title field to Assemble 32-bit.
  4. 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
  5. Insert the following in the Arguments field: -c $(ItemFileName).asm
  6. Insert the following in the Initial directory field: $(ItemDir)
  7. Uncheck the Close on exit checkbox.
  8. Click the OK button to save your tool.

Test the Assemble 32-bit Tool

  1. Using Visual C++ Express, open the Irvine32_Libary.sln file from the C:\Irvine\examples\Lib32\Irvine32_Library folder.
  2. Open the Irvine32.asm file in the editor.
  3. Click the Save button to update the file.
  4. Select Assemble 32-bit from the Tools menu.
  5. 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.

  1. Select External Tools from the Tools menu.
  2. Click the Add button in the External Tools dialog.
  3. Name the tool Update Irvine32 Library.
  4. 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.
  5. Insert the following value in the Arguments field:
    /subsystem:console Irvine32.obj floatio.obj
  6. Set the Initial directory field to $(ItemDir)
  7. Uncheck the Close on exit checkbox.
  8. 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!