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

Subversion Repositories marca

[/] [marca/] [trunk/] [spar/] [code.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 _CODE_H_
19
#define _CODE_H_
20
 
21
#include <stdint.h>
22
 
23
#define CODE_MAX_ARGS    3
24
#define CODE_MAX_LISTLEN 32
25
 
26
struct arg
27
{
28
  char mode;
29
  union
30
  {
31
    uint16_t regnum;
32
    char *expr;
33
  } val;
34
};
35
 
36
struct op
37
{
38
  uint16_t op;
39
  struct arg args [CODE_MAX_ARGS];
40
  uint16_t code;
41
  char listing [CODE_MAX_LISTLEN];
42
};
43
 
44
#include "segtab.h"
45
 
46
void        set_op(struct seg *, uint32_t, uint16_t);
47
uint16_t    get_op(struct seg *, uint32_t);
48
void        set_mode(struct seg *, uint32_t, uint8_t, char);
49
char        get_mode(struct seg *, uint32_t, uint8_t);
50
void        set_regnum(struct seg *, uint32_t, uint8_t, uint16_t);
51
uint16_t    get_regnum(struct seg *, uint32_t, uint8_t);
52
void        set_expr(struct seg *, uint32_t, uint8_t, char *);
53
char *      get_expr(struct seg *, uint32_t, uint8_t);
54
void        set_code(struct seg *, uint32_t, uint16_t);
55
uint16_t    get_code(struct seg *, uint32_t);
56
void        set_listing(struct seg *, uint32_t, const char *);
57
void        trace_listing(struct seg *, uint32_t, const char *);
58
const char *get_listing(struct seg *, uint32_t);
59
 
60
#endif /* _CODE_H_ */

powered by: WebSVN 2.1.0

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