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

Subversion Repositories marca

[/] [marca/] [tags/] [INITIAL/] [spar/] [optab.h] - Blame information for rev 8

Details | Compare with Previous | View Log

Line No. Rev Author Line
1 2 jeunes2
/* This file is part of the assembler "spar" for marca.
2
   Copyright (C) 2007 Wolfgang Puffitsch
3
 
4
   This program is free software; you can redistribute it and/or modify it
5
   under the terms of the GNU Library General Public License as published
6
   by the Free Software Foundation; either version 2, or (at your option)
7
   any later version.
8
 
9
   This program is distributed in the hope that it will be useful,
10
   but WITHOUT ANY WARRANTY; without even the implied warranty of
11
   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
12
   Library General Public License for more details.
13
 
14
   You should have received a copy of the GNU Library General Public
15
   License along with this program; if not, write to the Free Software
16
   Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA */
17
 
18
#ifndef _OPTAB_H_
19
#define _OPTAB_H_
20
 
21
#include <stdint.h>
22
 
23
#include "code.h"
24
#include "segtab.h"
25
 
26
struct arg_info
27
{
28
  char type;
29
  uint8_t width;
30
  uint8_t offset;
31
  int32_t min;
32
  int32_t max;
33
};
34
 
35
struct op_info
36
{
37
  uint16_t opcode;
38
  int8_t argc;
39
  struct arg_info argv [CODE_MAX_ARGS];
40
};
41
 
42
uint16_t get_op_code(struct seg *, uint32_t);
43
int8_t   get_arg_count(struct seg *, uint32_t);
44
char     get_arg_type(struct seg *, uint32_t, uint8_t);
45
uint8_t  get_arg_width(struct seg *, uint32_t, uint8_t);
46
uint8_t  get_arg_offset(struct seg *, uint32_t, uint8_t);
47
int32_t  get_arg_min(struct seg *, uint32_t, uint8_t);
48
int32_t  get_arg_max(struct seg *, uint32_t, uint8_t);
49
 
50
extern const struct op_info optab [];
51
 
52
#define DATA       0
53
#define ADD        1
54
#define SUB        2
55
#define ADDC       3
56
#define SUBC       4
57
#define AND        5
58
#define OR         6
59
#define XOR        7
60
#define MUL        8
61
#define DIV        9
62
#define UDIV      10
63
#define LDIL      11
64
#define LDIH      12
65
#define LDIB      13
66
 
67
#define MOV       14
68
#define MOD       15
69
#define UMOD      16
70
#define NOT       17
71
#define NEG       18
72
#define CMP       19
73
#define ADDI      20
74
#define CMPI      21
75
#define SHL       22
76
#define SHR       23
77
#define SAR       24
78
#define ROLC      25
79
#define RORC      26
80
#define BSET      27
81
#define BCLR      28
82
#define BTEST     29
83
 
84
#define LOAD      30
85
#define STORE     31
86
#define LOADL     32
87
#define LOADH     33
88
#define LOADB     34
89
#define STOREL    35
90
#define STOREH    36
91
#define CALL      37
92
 
93
#define BR        38
94
#define BRZ       39
95
#define BRNZ      40
96
#define BRLE      41
97
#define BRLT      42
98
#define BRGE      43
99
#define BRGT      44
100
#define BRULE     45
101
#define BRULT     46
102
#define BRUGE     47
103
#define BRUGT     48
104
#define SEXT      49
105
#define LDVEC     50
106
#define STVEC     51
107
 
108
#define JMP       52
109
#define JMPZ      53
110
#define JMPNZ     54
111
#define JMPLE     55
112
#define JMPLT     56
113
#define JMPGE     57
114
#define JMPGT     58
115
#define JMPULE    59
116
#define JMPULT    60
117
#define JMPUGE    61
118
#define JMPUGT    62
119
 
120
#define INTR      63
121
#define GETIRA    64
122
#define SETIRA    65
123
#define GETFL     66
124
#define SETFL     67
125
#define GETSHFL   68
126
#define SETSHFL   69
127
 
128
#define RETI      70
129
#define NOP       71
130
#define SEI       72
131
#define CLI       73
132
#define ERROR     74
133
 
134
#define ALIGN     75
135
#define COMM      76
136
#define LCOMM     77
137
#define ORG       78
138
#define SKIP      79
139
 
140
#endif /* _OPTAB_H_ */

powered by: WebSVN 2.1.0

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