[ library(asm) | Reference Manual | Alphabetic Index ]

# asm(+PredSpec, +WAMCode, +Flags)

Assemble the WAM instructions WAMCode into ECLiPSe in module Module as predicate PredSpec.

+PredSpec
  Atom/Integer.
+WAMCode
  A list of WAM instructions in the right format.
+Flags
  An integer.

## Description

Assembles the WAM instruction WAMCode into the current ECLiPSe session in an existing module Module as the predicate PredSpec. The WAM code is in the form of a list, with each element representing one WAM instruction. The format of the WAMCode is the same as that generated by disasm/2,3. Thus the predicate can be used to load a predicate previously dissasembled by disasm/2,3 without having to compile the source Prolog form of the predicate.

If PredSpec is an existing defined predicate, the older definition will be replaced. If WAMCode is not in the correct format, an exception will be generated and the predicate PredSpec would not be redefined.

### Fail Conditions

None.

### Resatisfiable

No.

### Exceptions

(5) type error
  PredSpec or Module is not in correct form.
(6) out of range
  WAMCode is not in correct form.
(80) not a module
  Module is not an existing module.

## See Also

asm / 2, disasm / 2, disasm / 3, pasm / 4