Next: , Previous: , Up: Assembler Instructions   [Contents][Index]


5.3.6 nop and nop1 Instructions

The mixed-type instructions nop and nop1 should have the corresponding instruction meta-classes registered for a multinode model.

The expected behavior of nop instruction is the absence of any effect except for the duplication of outcome of the previous instruction invoked by a node. You can define the instruction meta-class for the nop instruction by the following code block:

static QSMM_INSTR_META_CLASS(nop) {
    switch (qsmm_evt) {
        case QSMM_EVT_INSTR_CLASS_INIT:
            qsmm_set_eh_noutcome(qsmm,0);
            break;
    }
    return 0;
}

The assembler can implicitly generate nop instructions while assembling a program and produce warnings indicating the insertion locations of those instructions. Ideally, an assembler program should not have implicitly generated nop instructions.

The mixed-type instruction nop1 should have single outcome 0 the instruction always returns. Besides that, the instruction should not have any effect. You can define the instruction meta-class of nop1 instruction by the following code block:

static QSMM_INSTR_META_CLASS(nop1) {
    return 0;
}

You can insert a nop1 instruction after an stt instruction where it is not necessary to preserve the outcome of the previous instruction invoked by a node. The use of nop1 instruction instead of nop instruction reduces the number of profile probabilities written to the state transition matrix making it simpler and decreasing the amount of memory needed to store the matrix. The disassembler can generate the nop1 instruction at the beginning of an assembler program.