1
0
mirror of https://github.com/open-simh/simh.git synced 2026-04-27 20:48:20 +00:00

Bob Supnik's state as of 5/9/2015 after backporting some things from the master branch

This commit is contained in:
Mark Pizzolato
2015-05-10 05:48:11 -07:00
parent 3a279c013a
commit 4d48f44857
313 changed files with 80976 additions and 38242 deletions

View File

@@ -25,6 +25,7 @@
cpu 8080 CPU
02-Feb-15 RSB Fixed initialization of "uninstalled" memory
19-Mar-12 RMS Fixed data type for breakpoint variables
08-Oct-02 RMS Tied off spurious compiler warnings
@@ -67,7 +68,7 @@
3. Non-existent memory. On the 8080, reads to non-existent memory
return 0377, and writes are ignored. In the simulator, the
largest possible memory is instantiated and initialized to zero.
largest possible memory is instantiated and initialized to 0377.
Thus, only writes need be checked against actual memory size.
4. Adding I/O devices. These modules must be modified:
@@ -107,9 +108,6 @@ int32 chip = 0; /* 0 = 8080 chip, 1 = z8
int32 PCX; /* External view of PC */
extern int32 sim_int_char;
extern uint32 sim_brk_types, sim_brk_dflt, sim_brk_summ;/* breakpoint info */
/* function prototypes */
t_stat cpu_ex (t_value *vptr, t_addr addr, UNIT *uptr, int32 sw);
@@ -300,9 +298,8 @@ DEVICE cpu_dev = {
NULL, NULL, NULL
};
int32 sim_instr (void)
t_stat sim_instr (void)
{
extern int32 sim_interval;
int32 PC, IR, OP, DAR, reason, hi, lo, carry, i;
PC = saved_PC & ADDRMASK; /* load local PC */
@@ -313,7 +310,7 @@ int32 sim_instr (void)
while (reason == 0) { /* loop until halted */
if (sim_interval <= 0) { /* check clock queue */
if (reason = sim_process_event ()) break;
if ((reason = sim_process_event ())) break;
}
if (int_req > 0) { /* interrupt? */
@@ -366,7 +363,7 @@ int32 sim_instr (void)
if ((OP & 0xCF) == 0x01) { /* LXI */
DAR = M[PC] & 0x00ff;
PC++;
DAR = DAR | (M[PC] <<8) & 0xFF00;;
DAR = DAR | ((M[PC] <<8) & 0xFF00);
putpair((OP >> 4) & 0x03, DAR);
PC++;
continue;
@@ -1177,7 +1174,7 @@ for (i = val; i < MEMSIZE; i++) mc = mc | M[i];
if ((mc != 0) && (!get_yn ("Really truncate memory [N]?", FALSE)))
return SCPE_OK;
MEMSIZE = val;
for (i = MEMSIZE; i < MAXMEMSIZE; i++) M[i] = 0;
for (i = MEMSIZE; i < MAXMEMSIZE; i++) M[i] = 0377;
return SCPE_OK;
}

View File

@@ -24,19 +24,19 @@
in this Software without prior written authorization from Charles E. Owen.
*/
#include "sim_defs.h" /* simulator defns */
#include "sim_defs.h" /* simulator defns */
/* Memory */
#define MAXMEMSIZE 65536 /* max memory size */
#define MEMSIZE (cpu_unit.capac) /* actual memory size */
#define ADDRMASK (MAXMEMSIZE - 1) /* address mask */
#define MEM_ADDR_OK(x) (((uint32) (x)) < MEMSIZE)
#define MAXMEMSIZE 65536 /* max memory size */
#define MEMSIZE (cpu_unit.capac) /* actual memory size */
#define ADDRMASK (MAXMEMSIZE - 1) /* address mask */
#define MEM_ADDR_OK(x) (((uint32) (x)) < MEMSIZE)
/* Simulator stop codes */
#define STOP_RSRV 1 /* must be 1 */
#define STOP_HALT 2 /* HALT */
#define STOP_IBKPT 3 /* breakpoint */
#define STOP_OPCODE 4
#define STOP_RSRV 1 /* must be 1 */
#define STOP_HALT 2 /* HALT */
#define STOP_IBKPT 3 /* breakpoint */
#define STOP_OPCODE 4

View File

@@ -153,7 +153,7 @@ int32 oplen[256] = {
load starts at the current value of the PC.
*/
int32 sim_load (FILE *fileref, char *cptr, char *fnam, int flag)
t_stat sim_load (FILE *fileref, char *cptr, char *fnam, int flag)
{
int32 i, addr = 0, cnt = 0;
@@ -164,7 +164,7 @@ while ((i = getc (fileref)) != EOF) {
addr++;
cnt++;
} /* end while */
printf ("%d Bytes loaded.\n", cnt);
sim_printf ("%d Bytes loaded.\n", cnt);
return (SCPE_OK);
}
@@ -180,7 +180,7 @@ return (SCPE_OK);
status = error code
*/
int32 fprint_sym (FILE *of, int32 addr, uint32 *val,
t_stat fprint_sym (FILE *of, t_addr addr, t_value *val,
UNIT *uptr, int32 sw)
{
int32 cflag, c1, c2, inst, adr;
@@ -229,7 +229,7 @@ return -(oplen[inst] - 1);
status = error status
*/
int32 parse_sym (char *cptr, int32 addr, UNIT *uptr, uint32 *val, int32 sw)
t_stat parse_sym (char *cptr, t_addr addr, UNIT *uptr, t_value *val, int32 sw)
{
int32 cflag, i = 0, j, r;
char gbuf[CBUFSIZE];