diff --git a/PDP10/ka10_cpu.c b/PDP10/ka10_cpu.c index 79e9af1..64d632d 100644 --- a/PDP10/ka10_cpu.c +++ b/PDP10/ka10_cpu.c @@ -882,8 +882,10 @@ t_stat dev_apr(uint32 dev, uint64 *data) { nxm_flag = 0; if (res & 020000) mem_prot = 0; - if (res & 0200000) + if (res & 0200000) { reset_all(1); + clk_flg = ov_irq = fov_irq = nxm_flag = mem_prot = push_ovf = 0; + } if (res & 0400000) push_ovf = 0; check_apr_irq(); @@ -997,7 +999,7 @@ int page_lookup(int addr, int flag, int *loc, int wr, int cur_context) { uf = 0; else if (!uf && !cur_context && ((((xct_flag & 2) != 0 && wr != 0)) || ((xct_flag & 1) != 0 && (wr == 0 || modify)))) - uf = 1; + uf = (FLAGS & USERIO) != 0; if (uf) { base = ub_ptr; @@ -1531,6 +1533,12 @@ unasign: AB |= 4; Mem_read_nopage(); FLAGS = (MB >> 23) & 017777; + /* If transistioning from user to executive adjust flags */ + if ((FLAGS & USER) != 0 && (AB & 4) != 0) { + FLAGS |= USERIO; + if (AB & 2) + FLAGS |= OVR; + } PC = MB & RMASK; f_pc_inh = 1; trap_flag = 0; @@ -1560,7 +1568,7 @@ unasign: } #endif AB = 040; - Mem_write(uuo_cycle, 0); + Mem_write(uuo_cycle, 1); AB += 1; f_load_pc = 0; f_pc_inh = 1; diff --git a/PDP10/ka10_defs.h b/PDP10/ka10_defs.h index a3b838c..78473b8 100644 --- a/PDP10/ka10_defs.h +++ b/PDP10/ka10_defs.h @@ -168,27 +168,32 @@ extern DEBTAB crd_debug[]; #define LRZ(x) (((x) >> 18) & RMASK) -#define NODIV 000001 -#define FLTUND 000002 +#define NODIV 000001 /* 000040 */ +#define FLTUND 000002 /* 000100 */ #if KI|KL -#define TRP1 000004 -#define TRP2 000010 -#define ADRFLT 000020 -//#define PUBLIC 000000 -#define PUBLIC 000040 +#define TRP1 000004 /* 000200 */ +#define TRP2 000010 /* 000400 */ +#define ADRFLT 000020 /* 001000 */ +#define PUBLIC 000040 /* 002000 */ #else -#define TRP1 000000 -#define TRP2 000000 -#define ADRFLT 000000 -#define PUBLIC 000000 +#define TRP1 000000 +#define TRP2 000000 +#define ADRFLT 000000 +#define PUBLIC 000000 #endif -#define USERIO 000100 -#define USER 000200 -#define BYTI 000400 -#define FLTOVR 001000 -#define CRY1 002000 -#define CRY0 004000 -#define OVR 010000 +#define USERIO 000100 /* 004000 */ +#define USER 000200 /* 010000 */ +#define BYTI 000400 /* 020000 */ +#ifdef PDP6 +#define FLTOVR 000000 +#define PCHNG 001000 /* 040000 */ +#else +#define FLTOVR 001000 /* 040000 */ +#define PCHNG 000000 +#endif +#define CRY1 002000 /* 100000 */ +#define CRY0 004000 /* 200000 */ +#define OVR 010000 /* 400000 */ #define DATAI 00 #define DATAO 01