OpenFrame ASM Verification

This chapter describes how to compile the sample ASM file after installing OpenFrame ASM and about the compile command. It also describes how to use the interface module code generation tool and its command options, and how to use g++ to compile an interface module.

1. Compile

The following describes how to use the ofasm command to compile the sample ASM file after installing OpenFrame ASM.

  1. Find the sample file in the following location.

    $OFASM_HOME/sample
  2. Execute the ofasm command and compile the SAMPLE.asm file.

    ofasm ADD.asm
  3. If the following .asmo file is created after the compilation, then OpenFrame ASM has been installed successfully. The .asmo file is created in the $LD_LIBRARY_PATH folder.

    ADD.asmo

1.1. ofasm Command

The following describes how to use the OpenFrame ASM compile command (ofasm).

ofasm sourcefile... [command option...]
  • Source files

    The files to compile must have the 'asm' extension to be recognized as an ASM source file.

  • Basic compile command options

    Option Description

    -o file name

    Sets an output file.

    --debug

    Outputs log messages during preprocessing and compilation.

    -L <dir>

    Sets a macro library path.

    -h

    Displays help.

    --version

    Displays the current version information of OpenFrame ASM.

    -E

    Only executes preprocessing (input: *.asm file, output: *.asmi file).

    -S

    Only executes assembly (input: *.asmi file, output: *.asmo file).

    --enable-cics

    Enables CICS library.

    --list

    Displays macros, copybooks, and machine and assembler instructions supported in OpenFrame ASM.

2. Creating an Interface Module

The following describes how to use the ofasmif command to create an interface module after installing OpenFrame ASM.

  1. Find the sample JSON file in the following location.

    $OFASM_HOME/sample
  2. Execute the ofasmif command with the AD.json file to create the interface module.

    ofasmif -i ADD.json
  3. The following ADD_OFASM_VM_ENTRY.cpp file is created.

    ADD_OFASM_VM_ENTRY.cpp

2.1. ofasmif Command

The following describes how to use the ofasmif command.

ofasmif [command option...]
  • Basic ofasmif command options

    Option Description

    -i filename

    Sets an input file. Must have the json extension to be recognized as an interface specification file.

    -o filename

    Sets an output file.

    -p

    Enables auto indentation.

    -h

    Displays help.

3. Compiling an Interface Module with g++

The following shows how to compile an interface module using g++.

g++ -o libADD.so -shared -fPIC ADD_OFASM_VM_ENTRY.cpp -L$OFASM_HOME/lib -lofasmVM -L$TMAXDIR/lib -lcli