Corewar documentation 1.0.0
Loading...
Searching...
No Matches
myop.h File Reference

The header file of the op. More...

Go to the source code of this file.

Data Structures

struct  op_s
 
struct  header_s
 

Macros

#define MEM_SIZE   (6 * 1024)
 
#define IDX_MOD   512 /* modulo of the index */
 
#define MAX_ARGS_NUMBER   4 /* this may not be changed 2^*IND_SIZE */
 
#define COMMENT_CHAR   '#'
 
#define LABEL_CHAR   ':'
 
#define DIRECT_CHAR   '%'
 
#define SEPARATOR_CHAR   ','
 
#define LABEL_CHARS   "abcdefghijklmnopqrstuvwxyz_0123456789"
 
#define NAME_CMD_STRING   ".name"
 
#define COMMENT_CMD_STRING   ".comment"
 
#define REG_NUMBER   16 /* r1 <--> rx */
 
#define T_REG   1 /* register */
 
#define T_DIR   2 /* direct (ld #1,r1 put 1 into r1) */
 
#define T_IND
 
#define T_LAB   8 /* LABEL */
 
#define INSTRUCTION_ID_SIZE   1
 
#define CODING_BYTE_SIZE   1
 
#define IND_SIZE   2
 
#define DIR_SIZE   4
 
#define REG_SIZE   1
 
#define NO_CODE   0b00
 
#define REG_CODE   0b01
 
#define DIR_CODE   0b10
 
#define IND_CODE   0b11
 
#define DIR_IND_CODE   0b100
 
#define PROG_NAME_LENGTH   128
 
#define COMMENT_LENGTH   2048
 
#define COREWAR_EXEC_MAGIC   0xea83f3
 
#define CYCLE_TO_DIE   1536 /* number of cycle before being declared dead */
 
#define CYCLE_DELTA   5
 
#define NBR_LIVE   40
 

Typedefs

typedef char args_type_t
 
typedef struct op_s op_t
 
typedef struct header_s header_t
 

Variables

op_t op_tab []
 The op_tab containing the informations of the instructions.
 

Detailed Description

The header file of the op.

Macro Definition Documentation

◆ T_IND

#define T_IND
Value:
4 /* indirect always relative
* (ld 1,r1 put what's in the address (1+pc) into r1 (4 bytes )) */

Variable Documentation

◆ op_tab

op_t op_tab[]
extern

The op_tab containing the informations of the instructions.

Note
Given by EPITECH