1
0
mirror of https://github.com/open-simh/simh.git synced 2026-05-02 06:25:43 +00:00

PDP11: Add initial UC15 support from Bob Supnik

This commit is contained in:
Mark Pizzolato
2016-12-04 15:51:22 -08:00
parent fa1fba5bd5
commit 99bbc5f8cf
8 changed files with 171 additions and 81 deletions

View File

@@ -61,7 +61,7 @@ extern int32 cpu_log;
extern int32 autcon_enb;
extern int32 uba_last;
extern DEVICE cpu_dev;
extern t_addr cpu_memsize;
extern UNIT cpu_unit;
int32 calc_ints (int32 nipl, int32 trq);
@@ -250,9 +250,7 @@ if (cpu_bme) { /* map enabled? */
ma = Map_Addr (ba); /* map addr */
if (!ADDR_IS_MEM (ma)) /* NXM? err */
return (lim - ba);
if (ma & 1) /* get byte */
*buf++ = (M[ma >> 1] >> 8) & 0377;
else *buf++ = M[ma >> 1] & 0377;
*buf++ = (uint8) RdMemB (ma); /* get byte */
}
return 0;
}
@@ -260,12 +258,10 @@ else { /* physical */
if (ADDR_IS_MEM (lim)) /* end ok? */
alim = lim;
else if (ADDR_IS_MEM (ba)) /* no, strt ok? */
alim = cpu_memsize;
alim = MEMSIZE;
else return bc; /* no, err */
for ( ; ba < alim; ba++) { /* by bytes */
if (ba & 1)
*buf++ = (M[ba >> 1] >> 8) & 0377; /* get byte */
else *buf++ = M[ba >> 1] & 0377;
*buf++ = (uint8) RdMemB (ba); /* get byte */
}
return (lim - alim);
}
@@ -282,7 +278,7 @@ if (cpu_bme) { /* map enabled? */
ma = Map_Addr (ba); /* map addr */
if (!ADDR_IS_MEM (ma)) /* NXM? err */
return (lim - ba);
*buf++ = M[ma >> 1];
*buf++ = (uint16) RdMemW (ma);
}
return 0;
}
@@ -290,10 +286,10 @@ else { /* physical */
if (ADDR_IS_MEM (lim)) /* end ok? */
alim = lim;
else if (ADDR_IS_MEM (ba)) /* no, strt ok? */
alim = cpu_memsize;
alim = MEMSIZE;
else return bc; /* no, err */
for ( ; ba < alim; ba = ba + 2) { /* by words */
*buf++ = M[ba >> 1];
*buf++ = (uint16) RdMemW (ba);
}
return (lim - alim);
}
@@ -310,9 +306,7 @@ if (cpu_bme) { /* map enabled? */
ma = Map_Addr (ba); /* map addr */
if (!ADDR_IS_MEM (ma)) /* NXM? err */
return (lim - ba);
if (ma & 1) M[ma >> 1] = (M[ma >> 1] & 0377) |
((uint16) *buf++ << 8);
else M[ma >> 1] = (M[ma >> 1] & ~0377) | *buf++;
WrMemB (ma, ((uint16) *buf++));
}
return 0;
}
@@ -320,12 +314,10 @@ else { /* physical */
if (ADDR_IS_MEM (lim)) /* end ok? */
alim = lim;
else if (ADDR_IS_MEM (ba)) /* no, strt ok? */
alim = cpu_memsize;
alim = MEMSIZE;
else return bc; /* no, err */
for ( ; ba < alim; ba++) { /* by bytes */
if (ba & 1)
M[ba >> 1] = (M[ba >> 1] & 0377) | ((uint16) *buf++ << 8);
else M[ba >> 1] = (M[ba >> 1] & ~0377) | *buf++;
WrMemB (ba, ((uint16) *buf++));
}
return (lim - alim);
}
@@ -342,7 +334,7 @@ if (cpu_bme) { /* map enabled? */
ma = Map_Addr (ba); /* map addr */
if (!ADDR_IS_MEM (ma)) /* NXM? err */
return (lim - ba);
M[ma >> 1] = *buf++;
WrMemW (ma, *buf++);
}
return 0;
}
@@ -350,10 +342,10 @@ else { /* physical */
if (ADDR_IS_MEM (lim)) /* end ok? */
alim = lim;
else if (ADDR_IS_MEM (ba)) /* no, strt ok? */
alim = cpu_memsize;
alim = MEMSIZE;
else return bc; /* no, err */
for ( ; ba < alim; ba = ba + 2) { /* by words */
M[ba >> 1] = *buf++;
WrMemW (ba, *buf++);
}
return (lim - alim);
}