Native Instructions

ACUCOBOL-GT can also generate and execute object files that contain native instructions for selected families of processors. This results in generally faster code at the cost of reduced portability and larger object files.

Generally speaking, a native-code module will be a much more efficient user of the CPU. However, a native-code module will typically be several times larger than a portable object code module. You must weigh the benefits of better CPU utilization versus the cost of more memory used. For systems in which memory is tight, one solution is to use native code only for those modules that are CPU-intensive, while leaving the rest of the system in portable object code.

When you compile using native instructions, the resulting object file may be run only on a machine containing the appropriate processor. Note, however, that within this class of machines, the object file is still portable. For example, you could run an Intel object file on a Windows machine or on a Linux machine. There is no need (or benefit) to compile directly on the target machine.

See Supported Hardware for the complete list of platforms supported by ACUCOBOL-GT, and Native Code Supported Processors for the complete list of processors supported by its native-code functionality.

Object files that contain native-code instructions are similar to normal COBOL object files. The only difference is the internal instruction set used. Native-code object files are run in the same fashion as normal (portable) objects: by using the runtime. The runtime acts as the memory manager and support libraries for the native-code module. You may mix native and non-native modules in a single run freely.