## OrcOpcode

OrcOpcode — Operations

## Synopsis

    void                (*OrcOpcodeEmulateFunc)             (OrcOpcodeExecutor *ex,
                                                             void *user);
                        OrcOpcodeExecutor;
                        OrcOpcodeSet;
                        OrcRuleSet;
                        OrcStaticOpcode;
                        OrcTarget;
    #define             ORC_OPCODE_N_ARGS
    #define             ORC_STATIC_OPCODE_ACCUMULATOR
    #define             ORC_STATIC_OPCODE_N_DEST
    #define             ORC_STATIC_OPCODE_N_SRC
    OrcStaticOpcode *   orc_opcode_find_by_name             (const char *name);
    void                orc_opcode_init                     (void);
    int                 orc_opcode_register_static          (OrcStaticOpcode *sopcode,
                                                             char *prefix);
    int                 orc_opcode_set_find_by_name         (OrcOpcodeSet *opcode_set,
                                                             const char *name);
    OrcOpcodeSet *      orc_opcode_set_get                  (const char *name);
    OrcRuleSet *        orc_rule_set_new                    (OrcOpcodeSet *opcode_set,
                                                             OrcTarget *target,
                                                             unsigned int required_flags);
    const char *        orc_target_get_asm_preamble         (const char *target);
    OrcTarget *         orc_target_get_by_name              (const char *target_name);
    OrcTarget *         orc_target_get_default              (void);
    unsigned int        orc_target_get_default_flags        (OrcTarget *target);
    const char *        orc_target_get_name                 (OrcTarget *target);
    OrcRule *           orc_target_get_rule                 (OrcTarget *target,
                                                             OrcStaticOpcode *opcode,
                                                             unsigned int target_flags);
    void                orc_target_register                 (OrcTarget *target);

## Description

## Details

### OrcOpcodeEmulateFunc ()

    void                (*OrcOpcodeEmulateFunc)             (OrcOpcodeExecutor *ex,
                                                             void *user);

`ex` : |
`user` : |

### OrcOpcodeExecutor

    typedef struct {
    } OrcOpcodeExecutor;

The OrcOpcodeExecutor structure has no public members

### OrcOpcodeSet

    typedef struct {
    } OrcOpcodeSet;

The OrcOpcodeSet structure has no public members

### OrcRuleSet

    typedef struct {
    } OrcRuleSet;

The OrcRuleSet structure has no public members

### OrcStaticOpcode

    typedef struct {
      char name[16];
      OrcOpcodeEmulateFunc emulate;
      void *emulate_user;
      unsigned int flags;
      int dest_size[ORC_STATIC_OPCODE_N_DEST];
      int src_size[ORC_STATIC_OPCODE_N_SRC];
    } OrcStaticOpcode;

### OrcTarget

    typedef struct {
      const char *name;
      orc_bool executable;
      int data_register_offset;

      unsigned int (*get_default_flags)(void);
      void (*compiler_init)(OrcCompiler *compiler);
      void (*compile)(OrcCompiler *compiler);

      OrcRuleSet rule_sets[ORC_N_RULE_SETS];
      int n_rule_sets;

      const char * (*get_asm_preamble)(void);
      void (*load_constant)(OrcCompiler *compiler, int reg, int size, int value);

      void *_unused[8];
    } OrcTarget;

### ORC_OPCODE_N_ARGS

    #define ORC_OPCODE_N_ARGS 4

### ORC_STATIC_OPCODE_ACCUMULATOR

    #define ORC_STATIC_OPCODE_ACCUMULATOR (1<<0)

### ORC_STATIC_OPCODE_N_DEST

    #define ORC_STATIC_OPCODE_N_DEST 2

### ORC_STATIC_OPCODE_N_SRC

    #define ORC_STATIC_OPCODE_N_SRC 4

### orc_opcode_find_by_name ()

    OrcStaticOpcode *   orc_opcode_find_by_name             (const char *name);

`name` : |
Returns : |

### orc_opcode_init ()

    void                orc_opcode_init                     (void);

### orc_opcode_register_static ()

    int                 orc_opcode_register_static          (OrcStaticOpcode *sopcode,
                                                             char *prefix);

`sopcode` : |
`prefix` : |
Returns : |

### orc_opcode_set_find_by_name ()

    int                 orc_opcode_set_find_by_name         (OrcOpcodeSet *opcode_set,
                                                             const char *name);

`opcode_set` : |
`name` : |
Returns : |

### orc_opcode_set_get ()

    OrcOpcodeSet *      orc_opcode_set_get                  (const char *name);

`name` : |
Returns : |

### orc_rule_set_new ()

    OrcRuleSet *        orc_rule_set_new                    (OrcOpcodeSet *opcode_set,
                                                             OrcTarget *target,
                                                             unsigned int required_flags);

`opcode_set` : |
`target` : |
`required_flags` : |
Returns : |

### orc_target_get_asm_preamble ()

    const char *        orc_target_get_asm_preamble         (const char *target);

`target` : |
Returns : |

### orc_target_get_by_name ()

    OrcTarget *         orc_target_get_by_name              (const char *target_name);

`target_name` : |
Returns : |

### orc_target_get_default ()

    OrcTarget *         orc_target_get_default              (void);

Returns : |

### orc_target_get_default_flags ()

    unsigned int        orc_target_get_default_flags        (OrcTarget *target);

`target` : |
Returns : |

### orc_target_get_name ()

    const char *        orc_target_get_name                 (OrcTarget *target);

`target` : |
Returns : |

### orc_target_get_rule ()

    OrcRule *           orc_target_get_rule                 (OrcTarget *target,
                                                             OrcStaticOpcode *opcode,
                                                             unsigned int target_flags);

`target` : |
`opcode` : |
`target_flags` : |
Returns : |

### orc_target_register ()

    void                orc_target_register                 (OrcTarget *target);

`target` : |