1 /*********************************************************************************
\r
3 * --------------------------------------------------------------------------------
\r
5 * This file is part of MiMic
\r
6 * Copyright (C)2011 Ryo Iizuka
\r
8 * MiMic is free software: you can redistribute it and/or modify
\r
9 * it under the terms of the GNU Lesser General Public License as published
\r
10 * by the Free Software Foundation, either version 3 of the License, or
\r
11 * (at your option) any later version.
\r
13 * This program is distributed in the hope that it will be useful,
\r
14 * but WITHOUT ANY WARRANTY; without even the implied warranty of
\r
15 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
\r
16 * GNU General Public License for more details.
\r
18 * You should have received a copy of the GNU Lesser General Public License
\r
19 * along with this program. If not, see <http://www.gnu.org/licenses/>.
\r
21 * For further information please contact.
\r
23 * <airmail(at)ebony.plala.or.jp> or <nyatla(at)nyatla.jp>
\r
25 *********************************************************************************/
\r
26 #ifndef NYLPC_CMIMICVM_PROTECTED_H_
\r
27 #define NYLPC_CMIMICVM_PROTECTED_H_
\r
28 #include "NyLPC_cMiMicVM.h"
\r
32 #endif /* __cplusplus */
\r
33 //----------------------------------------------------------------------
\r
35 //----------------------------------------------------------------------
\r
37 #define NyLPC_TcMiMicVM_OP_TYPE_AND 0x11
\r
38 #define NyLPC_TcMiMicVM_OP_TYPE_OR 0x12
\r
39 #define NyLPC_TcMiMicVM_OP_TYPE_XOR 0x13
\r
40 #define NyLPC_TcMiMicVM_OP_TYPE_NOT 0x14
\r
42 #define NyLPC_TcMiMicVM_OP_TYPE_SHL 0x21
\r
43 #define NyLPC_TcMiMicVM_OP_TYPE_SHR 0x22
\r
45 #define NyLPC_TcMiMicVM_OP_TYPE_ADD 0x31
\r
46 #define NyLPC_TcMiMicVM_OP_TYPE_SUB 0x32
\r
47 #define NyLPC_TcMiMicVM_OP_TYPE_MUL 0x33
\r
49 #define NyLPC_TcMiMicVM_OP_TYPE_MGET 0x41
\r
50 #define NyLPC_TcMiMicVM_OP_TYPE_MPUT 0x42
\r
52 #define NyLPC_TcMiMicVM_OP_TYPE_SGET 0x51
\r
53 #define NyLPC_TcMiMicVM_OP_TYPE_SPUT 0x52
\r
55 #define NyLPC_TcMiMicVM_OP_TYPE_NOP 0x61
\r
56 #define NyLPC_TcMiMicVM_OP_TYPE_EXIT 0x62
\r
57 #define NyLPC_TcMiMicVM_OP_TYPE_CALL 0x63
\r
59 #define NyLPC_TcMiMicVM_OP_TYPE_LD 0x71
\r
62 #define NyLPC_TcMiMicVM_CP_TYPE_END 0x01
\r
64 #define NyLPC_TcMiMicVM_OP_TYPE_V_END 0x1001
\r
65 #define NyLPC_TcMiMicVM_OP_TYPE_V_DB8 0x1011
\r
66 #define NyLPC_TcMiMicVM_OP_TYPE_V_DB16 0x1012
\r
67 #define NyLPC_TcMiMicVM_OP_TYPE_V_DB32 0x1013
\r
70 //----------------------------------------------------------------------
\r
72 //----------------------------------------------------------------------
\r
74 #define NyLPC_TcMiMicVM_OPR_TYPE_NONE 0x01
\r
75 #define NyLPC_TcMiMicVM_OPR_TYPE_WM_WM 0x11
\r
76 #define NyLPC_TcMiMicVM_OPR_TYPE_WM_H08 0x12
\r
77 #define NyLPC_TcMiMicVM_OPR_TYPE_WM_H16 0x13
\r
78 #define NyLPC_TcMiMicVM_OPR_TYPE_WM_H32 0x14
\r
79 #define NyLPC_TcMiMicVM_OPR_TYPE_WM 0x21
\r
80 #define NyLPC_TcMiMicVM_OPR_TYPE_H08 0x22
\r
81 #define NyLPC_TcMiMicVM_OPR_TYPE_H16 0x23
\r
82 #define NyLPC_TcMiMicVM_OPR_TYPE_H32 0x24
\r
89 * インストラクションセットのバイナリデータ型。
\r
90 * MiMicVMで実行するインストラクションをバッファから参照するために使います。
\r
91 * キャスト元のバッファは、32bitのunsigned intを想定しています。境界は32bit単位です。
\r
96 union NyLPC_TcMiMicVM_TInstruction{
\r
101 NyLPC_TcMiMicVM_OP_TYPE opc;
\r
102 NyLPC_TUInt8 oprtype;
\r
107 * WM[8],WM[8]オペランドの命令を格納します。
\r
110 NyLPC_TcMiMicVM_OP_TYPE opc;
\r
111 NyLPC_TUInt8 oprtype;
\r
116 NyLPC_TcMiMicVM_OP_TYPE opc;
\r
117 NyLPC_TUInt8 oprtype;
\r
122 NyLPC_TcMiMicVM_OP_TYPE opc;
\r
123 NyLPC_TUInt8 oprtype;
\r
127 NyLPC_TcMiMicVM_OP_TYPE opc;
\r
128 NyLPC_TUInt8 oprtype;
\r
132 NyLPC_TcMiMicVM_OP_TYPE opc;
\r
133 NyLPC_TUInt8 oprtype;
\r
138 NyLPC_TcMiMicVM_OP_TYPE opc;
\r
139 NyLPC_TUInt8 oprtype;
\r
141 NyLPC_TUInt8 _padding;
\r
145 NyLPC_TcMiMicVM_OP_TYPE opc;
\r
146 NyLPC_TUInt8 oprtype;
\r
148 NyLPC_TUInt8 _padding;
\r
152 NyLPC_TcMiMicVM_OP_TYPE opc;
\r
153 NyLPC_TUInt8 oprtype;
\r
154 NyLPC_TUInt8 _padding[2];
\r
161 #endif /* __cplusplus */
\r
163 #endif /* NYLPC_CMIMICVM_PROTECTED_H_ */
\r