1 /* 2 $Id: instruction.h 2035 2019-10-26 15:15:31Z soci $ 3 4 This program is free software; you can redistribute it and/or modify 5 it under the terms of the GNU General Public License as published by 6 the Free Software Foundation; either version 2 of the License, or 7 (at your option) any later version. 8 9 This program is distributed in the hope that it will be useful, 10 but WITHOUT ANY WARRANTY; without even the implied warranty of 11 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 12 GNU General Public License for more details. 13 14 You should have received a copy of the GNU General Public License along 15 with this program; if not, write to the Free Software Foundation, Inc., 16 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. 17 18 */ 19 #ifndef INSTRUCTION_H 20 #define INSTRUCTION_H 21 #include "attributes.h" 22 #include "stdbool.h" 23 #include "inttypes.h" 24 struct cpu_s; 25 26 struct Obj; 27 28 extern MUST_CHECK struct Error *instruction(int, unsigned int, struct Obj *, linepos_t, struct linepos_s *); 29 extern void select_opcodes(const struct cpu_s *); 30 extern int lookup_opcode(const uint8_t *); 31 extern MUST_CHECK bool touval(struct Obj *, uval_t *, unsigned int, linepos_t); 32 extern MUST_CHECK bool toival(struct Obj *, ival_t *, unsigned int, linepos_t); 33 extern MUST_CHECK bool touaddress(struct Obj *, uval_t *, unsigned int, linepos_t); 34 extern MUST_CHECK bool toiaddress(struct Obj *, ival_t *, unsigned int, linepos_t); 35 extern MUST_CHECK struct Error *err_addressing(uint32_t, linepos_t, int); 36 37 extern bool longaccu, longindex, autosize; 38 extern uint32_t dpage; 39 extern unsigned int databank; 40 extern bool longbranchasjmp; 41 extern bool allowslowbranch; 42 #endif 43