X-Git-Url: https://jxself.org/git/?p=zilutils.git;a=blobdiff_plain;f=zilasm%2Fopcodes.h;h=53e350912f42ba17cd68b4292ddf62e388e1ee28;hp=bddcb0d90e53846c35ac6cf4c49053465370e31e;hb=82b0f84ab797141758929d16894d42e12ef79af7;hpb=fd453701e368225dd15e9df2e5b1752aebe454e8 diff --git a/zilasm/opcodes.h b/zilasm/opcodes.h index bddcb0d..53e3509 100644 --- a/zilasm/opcodes.h +++ b/zilasm/opcodes.h @@ -1,7 +1,7 @@ /* * opcodes.h -- part of ZilUtils/ZilAsm * - * Copyright (C) 2016 Jason Self + * Copyright (C) 2016, 2019 Jason Self * * Based on ZILF (c) 2010, 2015 Jesse McGrew * @@ -17,6 +17,8 @@ * * You should have received a copy of the GNU General Public License * along with this program. If not, see + * + * SPDX-License-Identifier: GPL-3.0-or-later */ #ifndef ZILASM_OPCODES @@ -24,26 +26,42 @@ #include "symtable.h" -typedef enum { - Zop_none = 0, - Zop_store = 1, // ..stores a result - Zop_branch = 2, // ..branches to a label - Zop_extra = 4, // ..takes an extra operand type byte, for a total of 8 possible operands - Zop_varargs = 8, // ..is nominally 2OP but can take up to 4 operands - Zop_string = 16, // ..has a string literal operand - Zop_label = 32, // ..can take a local label operand - Zop_indvar = 64, // ..first operand is an indirect variable number - Zop_call = 128, // ..first operand is a packed routine address - Zop_term = 256 // ..control flow does not pass to the following instruction +typedef enum +{ + Zop_none = 0, + Zop_store = 1, // ..stores a result + Zop_branch = 2, // ..branches to a label + Zop_extra = 4, // ..takes an extra operand type byte, for a total of 8 possible operands + Zop_varargs = 8, // ..is nominally 2OP but can take up to 4 operands + Zop_string = 16, // ..has a string literal operand + Zop_label = 32, // ..can take a local label operand + Zop_indvar = 64, // ..first operand is an indirect variable number + Zop_call = 128, // ..first operand is a packed routine address + Zop_term = 256 // ..control flow does not pass to the following instruction } ZOpcode_flags; -typedef struct { - unsigned opcode; - ZOpcode_flags flags; +typedef struct +{ + unsigned opcode; + ZOpcode_flags flags; } ZOpcode; extern Symtable *Opcodes; -void init_opcodes(int version, int inform_syntax); +void init_opcodes (int version, int inform_syntax); + +enum Opcodes +{ + Opcode_ADD = 20, + Opcode_ASHIFT = 259, + Opcode_ASSIGNED = 255, + Opcode_BAND = 9, + Opcode_PRINT = 141, + Opcode_PRINTI = 178, + Opcode_PRINTR = 179, + Opcode_QUIT = 186, + Opcode_CRLF = 187 +}; + -#endif /* ifndef ZILASM_OPCODES */ +#endif /* ifndef ZILASM_OPCODES */