home *** CD-ROM | disk | FTP | other *** search
/ OS/2 Shareware BBS: 11 Util / 11-Util.zip / bin2obj.zip / README.TXT < prev   
Text File  |  1996-03-12  |  4KB  |  105 lines

  1. Bin2Obj - Binary to object file conversion utility for OS/2
  2.  
  3.  
  4. Introduction
  5.  
  6. This simple programers' utility converts a binary file to an object file 
  7. which can be linked with other object files. This allows you to place any set 
  8. of bytes into your executable module, which can be accessed with an 
  9. "external" name you choose.
  10.  
  11. Borland used to (and may still) ship such a utility with their compilers. 
  12. I've missed it a little bit since moving to OS/2 and the IBM CSet compiler.
  13.  
  14. You might wonder why this utility is needed since one can use RESOURCE
  15. statements in an RC file for a similar purpose. The answer is that
  16. BIN2OBJ is not strictly necessary, but it can be a little easier and
  17. more efficient than RC. First, it's easier because you can "compile"
  18. your binary file directly, without having to prepare an RC source.
  19. Second, it's more efficient because you don't need to make any API call
  20. (DosGetResource); the resource is available using a conventional memory
  21. access.
  22.  
  23.  
  24. Installation
  25.  
  26. This tool consists of one executable, BIN2OBJ.EXE; this documentation,
  27. README.TXT; and optional examples in EXAMPLES.ZIP. To use the utility,
  28. place BIN2OBJ.EXE somewhere in your PATH.
  29.  
  30.  
  31. Usage
  32.  
  33. The following usage text is available by running BIN2OBJ without arguments.
  34.  
  35. Usage: BIN2OBJ [options] binfile symbolname [objfile]
  36.  
  37.    binfile    = name of the existing binary file.
  38.    symbolname = symbolic name used in the object file.
  39.    objfile    = name of the new object file; if not present.
  40.                   the object file name will be same as the
  41.                   binfile with an .obj extension.
  42.    options    = any of the following:
  43.      -n       = size of the binfile, as 32-bit value, will be put in front
  44.                   of the binary block so it's size can be queried.
  45.      -sName   = name of the segment; by default it is 'DATA32'.
  46.      -cClass  = class of the segment; by default it is 'DATA'.
  47.                   The recommended classes are 'DATA', 'CONST', or 'CODE'.
  48.  
  49.  
  50. Examples
  51.  
  52. I've provided an example package EXAMPLE.ZIP. To use it, unzip that file in a 
  53. convenient directory so you can delete the files later. EXAMPLE.CMD executes
  54. BIN2OBJ and then compiles and links using the CSet compiler ICC.
  55.  
  56. [Although I'm not familiar with the other OS/2 compilers, they almost
  57. certainly can compile and link, and can accept .OBJ files for linking.
  58. To use your compiler name, change the "CC = icc" line in the .CMD file.]
  59.  
  60. See EXAMPLE.CMD for the use of BIN2OBJ, and EXAMPLE.C for the use of
  61. BIN2OBJ's object files in C. The object files generated by BIN2OBJ
  62. should be useable in any language implementation permitting linkage,
  63. including C++ and assembler.
  64.  
  65.  
  66. Compatibility
  67.  
  68. The object file produced by BIN2OBJ is compatible with LINK386.EXE, provided 
  69. with OS/2. It will not be compatible with 16-bit linkers, and it is not known 
  70. if it is compatible with other 32-bit linkers. However, it is highly likely 
  71. that BIN2OBJ object files will be acceptable to any 32-bit OS/2 linker 
  72. compatible with the IBM OS/2 Object Module Format (OMF). Executables linked 
  73. with a BIN2OBJ object file were tested using IBM CSet++ 2.1. It was not 
  74. tested with other compilers, but it is highly likely it will work with any 
  75. 32-bit compiler or assembler which can link with OS/2 OMF object files.
  76.  
  77.  
  78. Distribution
  79.  
  80. BIN2OBJ.EXE, and the accompanying documentation and example files, are
  81. Copyright 1996 by Peter Kobak. This set of files may be freely
  82. distributed and used, but
  83.  
  84. 1) This entire package, unchanged, must be distributed together.
  85.  
  86. 2) You may not charge anything for this utility separately, nor include
  87. it as part of a "commercial", "shareware", or other for-fee product.
  88. However, the files _produced_ by BIN2OBJ may be used without
  89. restriction.
  90.  
  91. 3) Point 2 does not preclude nominal fees charged for common
  92. distribution schemes, such as large collections of "shareware" and
  93. "freeware" on diskettes or CDROMs, and on-line charges for electronic
  94. distribution.
  95.  
  96. 4) This package is provided "as-is" - in other words, it may not work
  97. correctly, and even if it causes you financial harm, Peter Kobak will
  98. not be held responsible.
  99.  
  100.  
  101. Peter Kobak
  102. kobak@voicenet.com
  103. 3/8/96
  104.  
  105.