1 /* swtp_defs.h: SWTP 6800 simulator definitions 2 3 Copyright (c) 2005-2012, William Beech 4 5 Permission is hereby granted, free of charge, to any person obtaining a 6 copy of this software and associated documentation files (the "Software"), 7 to deal in the Software without restriction, including without limitation 8 the rights to use, copy, modify, merge, publish, distribute, sublicense, 9 and/or sell copies of the Software, and to permit persons to whom the 10 Software is furnished to do so, subject to the following conditions: 11 12 The above copyright notice and this permission notice shall be included in 13 all copies or substantial portions of the Software. 14 15 THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL 18 WILLIAM A BEECH BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER 19 IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN 20 CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. 21 22 Except as contained in this notice, the name of William A Beech shall not 23 be used in advertising or otherwise to promote the sale, use or other dealings 24 in this Software without prior written authorization from William A Beech. 25 */ 26 27 #include <ctype.h> 28 #include "../../sim_defs.h" // simulator defs 29 30 /* Memory */ 31 32 #define MAXMEMSIZE 65536 // max memory size 33 #define MEMSIZE (m6800_unit.capac) // actual memory size 34 #define ADDRMASK (MAXMEMSIZE - 1) // address mask 35 #define MEM_ADDR_OK(x) (((uint32) (x)) < MEMSIZE) 36 37 /* debug definitions */ 38 39 #define DEBUG_flow 0x0001 40 #define DEBUG_read 0x0002 41 #define DEBUG_write 0x0004 42 #define DEBUG_level1 0x0008 43 #define DEBUG_level2 0x0010 44 #define DEBUG_reg 0x0020 45 #define DEBUG_asm 0x0040 46 #define DEBUG_all 0xFFFF 47 48 /* Simulator stop codes */ 49 50 #define STOP_RSRV 1 // must be 1 51 #define STOP_HALT 2 // HALT-really WAI 52 #define STOP_IBKPT 3 // breakpoint 53 #define STOP_OPCODE 4 // invalid opcode 54 #define STOP_MEMORY 5 // invalid memory address 55 56