Next: , Previous: , Up: Instruction Meta-class Definition   [Contents][Index]


4.3.5 Setting the Number of Instruction Outcomes

To an instruction class the number of instruction outcomes corresponds. Instructions that belong to the instruction class can return those outcomes. The outcomes returned may affect further execution of an assembler program.

The number of instruction outcomes must be non-negative. Special value 0 indicates that an instruction may analyze an outcome of the previous instruction invoked, use that outcome as its own outcome, or change it to a non-negative value less than the maximum number of outcomes of instruction classes that belong to the instruction class set. The default number of outcomes of instruction class is equal to 1.

The purpose of the following function is to set the number of instruction outcomes while processing event QSMM_EVT_INSTR_CLASS_INIT by the event handler function of instruction meta-class.

Function: int qsmm_set_eh_noutcome (qsmm_t model, int noutcome)

This function sets the number of outcomes of an instruction class associated with an event being processed. The function can only be called from the event handler function of the corresponding instruction meta-class while processing event QSMM_EVT_INSTR_CLASS_INIT. Handle model specifies a multinode model that instruction meta-class belongs to.

The function returns a non-negative value on success or a negative error code on failure. Currently, the following error codes can be returned.

QSMM_ERR_UNTIMELY

The function was not called from the event handler function of instruction meta-class while processing event QSMM_EVT_INSTR_CLASS_INIT.

QSMM_ERR_INVAL

The value of noutcome is negative.

To get the number of outcomes of an instruction class associated with an event processed by the event handler function of instruction meta-class, the following function can be used.

Function: int qsmm_get_eh_noutcome (qsmm_t model)

This function returns the number of outcomes of an instruction class associated with an event being processed. The function can only be called from the event handler function of an instruction meta-class while processing event QSMM_EVT_INSTR_CLASS_INIT, QSMM_EVT_INSTR_CLASS_DONE, or QSMM_EVT_ACTIVATE. Handle model specifies a multinode model that instruction meta-class belongs to.

On success, a non-negative value is returned. If the function is not called from the event handler function of instruction meta-class while processing event QSMM_EVT_INSTR_CLASS_INIT, QSMM_EVT_INSTR_CLASS_DONE, or QSMM_EVT_ACTIVATE, then negative error code QSMM_ERR_UNTIMELY will be returned.


Next: , Previous: , Up: Instruction Meta-class Definition   [Contents][Index]