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

Subversion Repositories tinyvliw8

[/] [tinyvliw8/] [trunk/] [tools/] [asm/] [src/] [instr.h] - Rev 5

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

#ifndef INSTR_H
#define INSTR_H
 
#include "list.h"
 
#define INSTR_FLAG_TILDE 0x01
#define INSTR_FLAG_MINUS 0x02
 
typedef enum _instr_opcode_e {
	instr_opcode_ld = 0,
	instr_opcode_ldi,
	instr_opcode_st,
	instr_opcode_sti,
	instr_opcode_add,
	instr_opcode_addi,
	instr_opcode_mov,
	instr_opcode_rla,
	instr_opcode_rlc,
	instr_opcode_rra,
	instr_opcode_rrc,
	instr_opcode_and,
	instr_opcode_nand,
	instr_opcode_or,
	instr_opcode_nor,
	instr_opcode_xor,
	instr_opcode_xnor,
	instr_opcode_jmp,
	instr_opcode_jc,
	instr_opcode_jz,
	instr_opcode_jnz
} instr_opcode_t;
 
typedef enum _operand_type_e {
	instr_operand_type_reg = 0,
	instr_operand_type_const,
	instr_operand_type_label,
} instr_operand_type_t;
 
typedef struct _operand_s {
	list_t list;
 
	instr_operand_type_t type;
 
	unsigned short value;
	unsigned char flags;
 
	char *label;
} instr_operand_t;
 
typedef struct _instr_s {
	instr_opcode_t opcode;
 
	list_t source;
	instr_operand_t dest;
} instr_t;
 
typedef struct _vliw_instr_s {
	list_t list;
 
	unsigned short addr;
 
	unsigned char num;
	instr_t instr[2];
} instr_vliw_t;
 
typedef struct _instr_label_s {
	list_t list;
 
	unsigned int offset;
	char name[0];
} instr_label_t;
 
void instr_label(const char *name);
void instr_add(const instr_t *instr, const unsigned char num);
void instr_add_source(list_t *head, instr_operand_type_t type, const void *data);
void instr_add_dest(instr_operand_t *op, const unsigned char num);
void instr_source_flag(list_t *source, unsigned char flag);
void instr_irq(unsigned char num);
 
#endif
 

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

powered by: WebSVN 2.1.0

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