-
Notifications
You must be signed in to change notification settings - Fork 0
/
op.c
44 lines (42 loc) · 1.47 KB
/
op.c
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
/*
** EPITECH PROJECT, 2023
** B-CPE-200-PAR-2-1-corewar-damian.gil
** File description:
** op
**
**
** Original header:
** op.c for korewar
**
** Made by Astek
** Login <[email protected]>
**
** Started on Mon Mar 30 11:14:31 2009 Astek
** Last update Tue Mar 22 16:44:20 2011 Astek
*/
#include "op.h"
const op_t op_tab[] = {
{"live", 1, {T_DIR}, 1, 10, "alive"},
{"ld", 2, {T_DIR | T_IND, T_REG}, 2, 5, "load"},
{"st", 2, {T_REG, T_IND | T_REG}, 3, 5, "store"},
{"add", 3, {T_REG, T_REG, T_REG}, 4, 10, "addition"},
{"sub", 3, {T_REG, T_REG, T_REG}, 5, 10, "soustraction"},
{"and", 3, {T_REG | T_DIR | T_IND, T_REG | T_IND | T_DIR, T_REG}, 6, 6,
"et (and r1, r2, r3 r1&r2 -> r3"},
{"or", 3, {T_REG | T_IND | T_DIR, T_REG | T_IND | T_DIR, T_REG}, 7, 6,
"ou (or r1, r2, r3 r1 | r2 -> r3"},
{"xor", 3, {T_REG | T_IND | T_DIR, T_REG | T_IND | T_DIR, T_REG}, 8, 6,
"ou (xor r1, r2, r3 r1^r2 -> r3"},
{"zjmp", 1, {T_DIR}, 9, 20, "jump if zero"},
{"ldi", 3, {T_REG | T_DIR | T_IND, T_DIR | T_REG, T_REG}, 10, 25,
"load index"},
{"sti", 3, {T_REG, T_REG | T_DIR | T_IND, T_DIR | T_REG}, 11, 25,
"store index"},
{"fork", 1, {T_DIR}, 12, 800, "fork"},
{"lld", 2, {T_DIR | T_IND, T_REG}, 13, 10, "long load"},
{"lldi", 3, {T_REG | T_DIR | T_IND, T_DIR | T_REG, T_REG}, 14, 50,
"long load index"},
{"lfork", 1, {T_DIR}, 15, 1000, "long fork"},
{"aff", 1, {T_REG}, 16, 2, "aff"},
{0, 0, {0}, 0, 0, 0}
};