1 #ifndef __OPCODE_BRANCH_LOOKUP_HPP__ 2 #define __OPCODE_BRANCH_LOOKUP_HPP__ 3 4 /* "Species" - a CoreWars evolver. Copyright (C) 2003 'Varfar' 5 * 6 * This program is free software; you can redistribute it and/or modify it 7 * under the terms of the GNU General Public License as published by the Free 8 * Software Foundation; either version 1, or (at your option) any later 9 * version. 10 * 11 * This program is distributed in the hope that it will be useful, but WITHOUT 12 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or 13 * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for 14 * more details. 15 * 16 * You should have received a copy of the GNU General Public License along 17 * with this program; if not, write to the Free Software Foundation, Inc., 18 * 675 Mass Ave, Cambridge, MA 02139, USA. 19 */ 20 21 /* this file publishes a lookup for code that is interested in whether something is a branch or not 22 * a BRANCH is an instruction that (may) jump to it's A field 23 * a SKIP is an instruction that (may) skip the next instruction 24 * a CONTINUES is an instruction that (may) continue to the next instruction; only JMP and DAT aren't, infact 25 */ 26 27 #include "insn.h" 28 29 extern const bool 30 OPCODE_IS_BRANCH[OPCODE_LAST], 31 OPCODE_IS_SKIP[OPCODE_LAST], 32 OPCODE_CONTINUES[OPCODE_LAST], 33 OPCODE_IS_BRANCH_OR_SKIP[OPCODE_LAST]; 34 extern const int 35 NUM_OPCODE_BRANCHES, 36 NUM_OPCODE_SKIPS, 37 NUM_OPCODE_CONTINUES; 38 39 40 MODIFIER EFFECTIVE_MODIFIER(const OPCODE opcode,const MODIFIER modifier); 41 unsigned EFFECTIVE_MODIFIERS(const OPCODE opcode); 42 43 const char *MNEMONIC_OPCODE(const OPCODE opcode); 44 const char *MNEMONIC_MODIFIER(const MODIFIER modifier); 45 const char MNEMONIC_ADDRMODE(const ADDRMODE addrmode); 46 47 #endif // __OPCODE_BRANCH_LOOKUP_HPP__ 48 49