@@ -126,6 +126,9 @@ uint64 MI; /* Monitor lights */
126
126
uint32 FLAGS ; /* Flags */
127
127
uint32 AC ; /* Operand accumulator */
128
128
uint64 SW ; /* Switch register */
129
+ #if PDP6 | KA | KI
130
+ t_addr AS ; /* Address switches */
131
+ #endif
129
132
int BYF5 ; /* Flag for second half of LDB/DPB instruction */
130
133
int uuo_cycle ; /* Uuo cycle in progress */
131
134
int SC ; /* Shift count */
@@ -138,6 +141,15 @@ int push_ovf; /* Push stack overflow */
138
141
int mem_prot ; /* Memory protection flag */
139
142
#endif
140
143
int nxm_flag ; /* Non-existant memory flag */
144
+ #if KA | KI
145
+ int adr_flag ; /* Address break flag */
146
+ int adr_cond ; /* Address condition swiches */
147
+ #define ADR_IFETCH 020
148
+ #define ADR_DFETCH 010
149
+ #define ADR_WRITE 004
150
+ #define ADR_STOP 002
151
+ #define ADR_BREAK 001
152
+ #endif
141
153
int clk_flg ; /* Clock flag */
142
154
int ov_irq ; /* Trap overflow */
143
155
int fov_irq ; /* Trap floating overflow */
@@ -450,7 +462,10 @@ REG cpu_reg[] = {
450
462
{ ORDATAD (PIE , PIE , 8 , "Priority Interrupt Enable" ) },
451
463
{ ORDATAD (PIENB , pi_enable , 7 , "Enable Priority System" ) },
452
464
{ ORDATAD (SW , SW , 36 , "Console SW Register" ), REG_FIT },
453
- { ORDATAD (MI , MI , 36 , "Monitor Display" ), REG_FIT },
465
+ { ORDATAD (MI , MI , 36 , "Memory Indicators" ), REG_FIT },
466
+ #if PDP6 | KA | KI
467
+ { ORDATAD (AS , AS , 18 , "Console AS Register" ), REG_FIT },
468
+ #endif
454
469
{ FLDATAD (BYF5 , BYF5 , 0 , "Byte Flag" ) },
455
470
{ FLDATAD (UUO , uuo_cycle , 0 , "UUO Cycle" ) },
456
471
#if KA | PDP6
@@ -463,6 +478,10 @@ REG cpu_reg[] = {
463
478
{ FLDATAD (MEMPROT , mem_prot , 0 , "Memory protection flag" ) },
464
479
#endif
465
480
{ FLDATAD (NXM , nxm_flag , 0 , "Non-existing memory access" ) },
481
+ #if KA | KI
482
+ { FLDATAD (ABRK , adr_flag , 0 , "Address break" ) },
483
+ { ORDATAD (ACOND , adr_cond , 5 , "Address condition switches" ) },
484
+ #endif
466
485
{ FLDATAD (CLK , clk_flg , 0 , "Clock interrupt" ) },
467
486
{ FLDATAD (OV , ov_irq , 0 , "Overflow enable" ) },
468
487
#if PDP6
@@ -1040,6 +1059,9 @@ t_stat dev_pi(uint32 dev, uint64 *data) {
1040
1059
#if KI | KL
1041
1060
res |= ((uint64 )(PIR ) << 18 );
1042
1061
#endif
1062
+ #if KI
1063
+ res |= ((uint64 )adr_flag << 31 );
1064
+ #endif
1043
1065
#if !KL
1044
1066
res |= ((uint64 )parity_irq << 15 );
1045
1067
#endif
@@ -1501,7 +1523,7 @@ void check_apr_irq() {
1501
1523
if (pi_enable && apr_irq ) {
1502
1524
int flg = 0 ;
1503
1525
clr_interrupt (0 );
1504
- flg |= inout_fail | nxm_flag ;
1526
+ flg |= inout_fail | nxm_flag | adr_flag ;
1505
1527
if (flg )
1506
1528
set_interrupt (0 , apr_irq );
1507
1529
}
@@ -1652,7 +1674,7 @@ void check_apr_irq() {
1652
1674
clr_interrupt (0 );
1653
1675
flg |= ((FLAGS & OVR ) != 0 ) & ov_irq ;
1654
1676
flg |= ((FLAGS & FLTOVR ) != 0 ) & fov_irq ;
1655
- flg |= nxm_flag | mem_prot | push_ovf ;
1677
+ flg |= nxm_flag | mem_prot | push_ovf | adr_flag ;
1656
1678
if (flg )
1657
1679
set_interrupt (0 , apr_irq );
1658
1680
}
@@ -1686,7 +1708,7 @@ t_stat dev_apr(uint32 dev, uint64 *data) {
1686
1708
res |= (((FLAGS & FLTOVR ) != 0 ) << 6 ) | (fov_irq << 7 ) ;
1687
1709
res |= (clk_flg << 9 ) | (((uint64 )clk_en ) << 10 ) | (nxm_flag << 12 );
1688
1710
res |= (mem_prot << 13 ) | (((FLAGS & USERIO ) != 0 ) << 15 );
1689
- res |= (push_ovf << 16 ) | (maoff >> 1 );
1711
+ res |= (adr_flag << 14 ) | ( push_ovf << 16 ) | (maoff >> 1 );
1690
1712
* data = res ;
1691
1713
sim_debug (DEBUG_CONI , & cpu_dev , "CONI APR %012llo\n" , * data );
1692
1714
break ;
@@ -1725,6 +1747,8 @@ t_stat dev_apr(uint32 dev, uint64 *data) {
1725
1747
nxm_flag = 0 ;
1726
1748
if (res & 020000 )
1727
1749
mem_prot = 0 ;
1750
+ if (res & 040000 )
1751
+ adr_flag = 0 ;
1728
1752
if (res & 0200000 ) {
1729
1753
#if MPX_DEV
1730
1754
mpx_enable = 0 ;
@@ -2998,6 +3022,27 @@ int Mem_write_byte(int n, uint16 *data) {
2998
3022
2999
3023
#endif
3000
3024
3025
+ #if KA | KI
3026
+ static void
3027
+ address_conditions (int fetch , int write )
3028
+ {
3029
+ int cond ;
3030
+ if (fetch )
3031
+ cond = ADR_IFETCH ;
3032
+ else if (write )
3033
+ cond = ADR_WRITE ;
3034
+ else
3035
+ cond = ADR_DFETCH ;
3036
+ if (adr_cond & cond ) {
3037
+ if (adr_cond & ADR_STOP )
3038
+ watch_stop = 1 ;
3039
+ if (adr_cond & ADR_BREAK )
3040
+ adr_flag = 1 ;
3041
+ }
3042
+ check_apr_irq ();
3043
+ }
3044
+ #endif
3045
+
3001
3046
#if KI
3002
3047
/*
3003
3048
* Load the TLB entry, used for both page_lookup and MAP.
@@ -3067,6 +3112,9 @@ int page_lookup(t_addr addr, int flag, t_addr *loc, int wr, int cur_context, int
3067
3112
if (page_fault )
3068
3113
return 0 ;
3069
3114
3115
+ if (adr_cond && addr == AS )
3116
+ address_conditions (fetch , wr );
3117
+
3070
3118
/* If paging is not enabled, address is direct */
3071
3119
if (!page_enable ) {
3072
3120
* loc = addr ;
@@ -3300,6 +3348,9 @@ int page_lookup_its(t_addr addr, int flag, t_addr *loc, int wr, int cur_context,
3300
3348
int uf = (FLAGS & USER ) != 0 ;
3301
3349
int ofd = (int )fault_data ;
3302
3350
3351
+ if (adr_cond && addr == AS )
3352
+ address_conditions (fetch , wr );
3353
+
3303
3354
/* If paging is not enabled, address is direct */
3304
3355
if (!page_enable ) {
3305
3356
* loc = addr ;
@@ -3577,6 +3628,9 @@ int page_lookup_bbn(t_addr addr, int flag, t_addr *loc, int wr, int cur_context,
3577
3628
if (page_fault )
3578
3629
return 0 ;
3579
3630
3631
+ if (adr_cond && addr == AS )
3632
+ address_conditions (fetch , wr );
3633
+
3580
3634
/* If paging is not enabled, address is direct */
3581
3635
if (!page_enable ) {
3582
3636
* loc = addr ;
@@ -3872,6 +3926,9 @@ int page_lookup_waits(t_addr addr, int flag, t_addr *loc, int wr, int cur_contex
3872
3926
/* If this is modify instruction use write access */
3873
3927
wr |= modify ;
3874
3928
3929
+ if (adr_cond && addr == AS )
3930
+ address_conditions (fetch , wr );
3931
+
3875
3932
/* Figure out if this is a user space access */
3876
3933
if (flag )
3877
3934
uf = 0 ;
@@ -3970,6 +4027,9 @@ int Mem_write_waits(int flag, int cur_context) {
3970
4027
#endif
3971
4028
3972
4029
int page_lookup_ka (t_addr addr , int flag , t_addr * loc , int wr , int cur_context , int fetch ) {
4030
+ if (adr_cond && addr == AS )
4031
+ address_conditions (fetch , wr );
4032
+
3973
4033
if (!flag && (FLAGS & USER ) != 0 ) {
3974
4034
if (addr <= Pl ) {
3975
4035
* loc = (addr + Rl ) & RMASK ;
@@ -4216,6 +4276,10 @@ int Mem_write(int flag, int cur_context) {
4216
4276
* Return of 0 if successful, 1 if there was an error.
4217
4277
*/
4218
4278
int Mem_read_nopage () {
4279
+ #if KA | KI
4280
+ if (adr_cond && AB == AS )
4281
+ address_conditions (0 , 0 );
4282
+ #endif
4219
4283
if (AB < 020 ) {
4220
4284
MB = get_reg (AB );
4221
4285
} else {
@@ -4240,6 +4304,10 @@ int Mem_read_nopage() {
4240
4304
* Return of 0 if successful, 1 if there was an error.
4241
4305
*/
4242
4306
int Mem_write_nopage () {
4307
+ #if KA | KI
4308
+ if (adr_cond && AB == AS )
4309
+ address_conditions (0 , 1 );
4310
+ #endif
4243
4311
if (AB < 020 ) {
4244
4312
set_reg (AB , MB );
4245
4313
} else {
@@ -13447,6 +13515,9 @@ t_stat cpu_reset (DEVICE *dptr)
13447
13515
#if ITS | BBN
13448
13516
page_enable = 0 ;
13449
13517
#endif
13518
+ #endif
13519
+ #if KA | KI
13520
+ adr_flag = 0 ;
13450
13521
#endif
13451
13522
nxm_flag = clk_flg = 0 ;
13452
13523
PIR = PIH = PIE = pi_enable = parity_irq = 0 ;
0 commit comments