Next: Printing an Assembler Program, Previous: Disassembling a Node, Up: Assembler Programs [Contents][Index]
Use the following function to get the number of instructions contained in an assembler program.
This function returns the number of instructions contained in a program prg. A returned value is always non-negative.
Use the following function to get an instruction contained in an assembler program.
This function returns an instruction contained in a program prg at zero-based index instr_idx.
If instr_idx is negative or greater than or equal to the number of instructions in the program, the function returns NULL
.
The following enumeration specifies the type of an assembler instruction.
This enumeration represents the type of an assembler instruction. The enumeration contains the following elements.
QSMM_INSTR_USER
A user or mixed-type instruction.
QSMM_INSTR_JMP
A jmp
instruction.
QSMM_INSTR_JPROB
A jprob
instruction.
QSMM_INSTR_CASE
A case
instruction (in a choice
instruction block).
QSMM_INSTR_CHOICE
A choice
instruction.
QSMM_INSTR_JOE
A joe
instruction.
QSMM_INSTR_STT
An stt
instruction.
QSMM_INSTR_END
An end choice
instruction (at the end of a choice
instruction block).
Use the following function to get the type of an assembler instruction.
This function returns the type of an instruction instr.
The function qsmm_get_prg_instr
does not return instructions with the types QSMM_INSTR_CASE
and QSMM_INSTR_END
.
Instead, it can return an instruction with the type QSMM_INSTR_CHOICE
representing a choice
instruction block containing nested case
instructions and a nested end choice
instruction.
Use the following function to get the number of instructions nested in a choice
instruction block.
This function returns the number of instructions nested in an instruction instr with the type QSMM_INSTR_CHOICE
.
For instructions with other types, the function returns 0.
Use the following function to get a nested case
or end choice
instruction.
This function returns an instruction nested in an instruction instr with the type QSMM_INSTR_CHOICE
.
The argument nested_idx specifies zero-based index of a nested instruction.
If the instruction instr does not have the type QSMM_INSTR_CHOICE
, or nested_idx is greater than or equal to the number of instructions nested in the instruction instr, the function returns NULL
.
An instruction can have location labels placed to the left of this instruction or before it.
You can use a location label assigned to a choice
instruction block to refer to an output probabilities array containing elements corresponding to case
instructions in the block (see Output Arrays).
Use the following function to get the number of location labels assigned to an instruction.
This function returns the number of location labels assigned to an instruction instr normally placed to the left of this instruction or before it.
Use the following function to get a location label by its index.
This function returns a location label at zero-based index label_idx assigned to an instruction instr.
If label_idx is greater than or equal to the number of location labels assigned to the instruction, the function returns NULL
.
Next: Printing an Assembler Program, Previous: Disassembling a Node, Up: Assembler Programs [Contents][Index]