OpenCores
URL https://opencores.org/ocsvn/tinyvliw8/tinyvliw8/trunk

Subversion Repositories tinyvliw8

[/] [tinyvliw8/] [trunk/] [tools/] [asm/] [src/] [instr.h] - Blame information for rev 5

Go to most recent revision | Details | Compare with Previous | View Log

Line No. Rev Author Line
1 5 steckol
#ifndef INSTR_H
2
#define INSTR_H
3
 
4
#include "list.h"
5
 
6
#define INSTR_FLAG_TILDE 0x01
7
#define INSTR_FLAG_MINUS 0x02
8
 
9
typedef enum _instr_opcode_e {
10
        instr_opcode_ld = 0,
11
        instr_opcode_ldi,
12
        instr_opcode_st,
13
        instr_opcode_sti,
14
        instr_opcode_add,
15
        instr_opcode_addi,
16
        instr_opcode_mov,
17
        instr_opcode_rla,
18
        instr_opcode_rlc,
19
        instr_opcode_rra,
20
        instr_opcode_rrc,
21
        instr_opcode_and,
22
        instr_opcode_nand,
23
        instr_opcode_or,
24
        instr_opcode_nor,
25
        instr_opcode_xor,
26
        instr_opcode_xnor,
27
        instr_opcode_jmp,
28
        instr_opcode_jc,
29
        instr_opcode_jz,
30
        instr_opcode_jnz
31
} instr_opcode_t;
32
 
33
typedef enum _operand_type_e {
34
        instr_operand_type_reg = 0,
35
        instr_operand_type_const,
36
        instr_operand_type_label,
37
} instr_operand_type_t;
38
 
39
typedef struct _operand_s {
40
        list_t list;
41
 
42
        instr_operand_type_t type;
43
 
44
        unsigned short value;
45
        unsigned char flags;
46
 
47
        char *label;
48
} instr_operand_t;
49
 
50
typedef struct _instr_s {
51
        instr_opcode_t opcode;
52
 
53
        list_t source;
54
        instr_operand_t dest;
55
} instr_t;
56
 
57
typedef struct _vliw_instr_s {
58
        list_t list;
59
 
60
        unsigned short addr;
61
 
62
        unsigned char num;
63
        instr_t instr[2];
64
} instr_vliw_t;
65
 
66
typedef struct _instr_label_s {
67
        list_t list;
68
 
69
        unsigned int offset;
70
        char name[0];
71
} instr_label_t;
72
 
73
void instr_label(const char *name);
74
void instr_add(const instr_t *instr, const unsigned char num);
75
void instr_add_source(list_t *head, instr_operand_type_t type, const void *data);
76
void instr_add_dest(instr_operand_t *op, const unsigned char num);
77
void instr_source_flag(list_t *source, unsigned char flag);
78
void instr_irq(unsigned char num);
79
 
80
#endif

powered by: WebSVN 2.1.0

© copyright 1999-2024 OpenCores.org, equivalent to Oliscience, all rights reserved. OpenCores®, registered trademark.