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


5.3.7 lookup Instruction

This instruction is a mixed-type instruction. The disassembler can generate lookup instructions when disassembling a node of a multinode model with positive length of look-ahead signal segment. The field ngram_env_la_sz of qsmm_desc_s structure passed to the function qsmm_create specifies this length when creating the multinode model. The function qsmm_get_ngram_env_la_sz fetches this length for an existing multinode model.

The instruction has the syntax

        lookup  position

and sets the outcome equal to a look-ahead signal at zero-based position in the look-ahead signal segment.

The assembler does not support loading assembler programs into the nodes of a multinode model with positive length of look-ahead signal segment. Therefore, if you need to assemble a program (e.g. generated by the disassembler) containing lookup instructions, you do the following:

  1. Create a multinode model with zero-length look-ahead signal segment.
  2. Register the instruction meta-class ‘lookup’.
  3. Register instruction classes derived from the instruction meta-class ‘lookup’ for possible values of position. Instructions belonging to those instruction classes fetch signals at specified positions from an array used as a substitute for the look-ahead signal segment.
  4. Modify the elements of this array where you would modify the elements of look-ahead signal segment.