This source file includes following definitions.
- doAppendCycleOperandRead_
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59 static ALWAYS_INLINE word24 doAppendCycleOperandRead_ (cpu_state_t * cpup, word36 * data, uint nWords, const bool full) {
60 static int evcnt = 0;
61 DCDstruct * i = & cpu.currentInstruction;
62 (void)evcnt;
63 DBGAPP ("doAppendCycleOperandRead(Entry) thisCycle=OPERAND_READ\r\n");
64 DBGAPP ("doAppendCycleOperandRead(Entry) lastCycle=%s\r\n", str_pct (cpu.apu.lastCycle));
65 DBGAPP ("doAppendCycleOperandRead(Entry) CA %06o\r\n", cpu.TPR.CA);
66 DBGAPP ("doAppendCycleOperandRead(Entry) n=%2u\r\n", nWords);
67 DBGAPP ("doAppendCycleOperandRead(Entry) PPR.PRR=%o PPR.PSR=%05o\r\n", cpu.PPR.PRR, cpu.PPR.PSR);
68 DBGAPP ("doAppendCycleOperandRead(Entry) TPR.TRR=%o TPR.TSR=%05o\r\n", cpu.TPR.TRR, cpu.TPR.TSR);
69
70 if (i->b29) {
71 DBGAPP ("doAppendCycleOperandRead(Entry) isb29 PRNO %o\r\n", GET_PRN (IWB_IRODD));
72 }
73
74 uint this = UC_OPERAND_READ;
75 if (i->info->flags & TRANSFER_INS)
76 this = UC_OPERAND_READ_TRA;
77 if (i->info->flags & CALL6_INS)
78 this = UC_OPERAND_READ_CALL6;
79
80 word24 finalAddress = 0;
81 word24 pageAddress = 0;
82 word3 RSDWH_R1 = 0;
83 word14 bound = 0;
84 word1 p = 0;
85 bool paged;
86
87
88
89
90 #if defined(TEST_UCACHE)
91 bool cacheHit;
92 cacheHit = false;
93 #endif
94
95
96
97
98
99
100 if (i->info->flags & CALL6_INS) {
101 # if defined(UCACHE_STATS)
102 cpu.uCache.call6Skips ++;
103 # endif
104 goto skip;
105 }
106
107
108
109
110
111
112
113
114
115
116
117 if (i->info->flags & TRANSFER_INS) {
118
119 if (cpu.rRALR && (cpu.PPR.PRR >= cpu.rRALR)) {
120 #if defined(UCACHE_STATS)
121 cpu.uCache.ralrSkips ++;
122 #endif
123 goto skip;
124 }
125 }
126
127
128
129 #if defined(TEST_UCACHE)
130 word24 cachedAddress;
131 word3 cachedR1;
132 word14 cachedBound;
133 word1 cachedP;
134 bool cachedPaged;
135 cacheHit =
136 ucCacheCheck (cpup, this, cpu.TPR.TSR, cpu.TPR.CA, & cachedBound, & cachedP, & cachedAddress, & cachedR1, & cachedPaged);
137 # if defined(HDBG)
138 hdbgNote ("doAppendCycleOperandRead.h", "test cache check %s %d %u %05o:%06o %05o %o %08o %o %o",
139 cacheHit ? "hit" : "miss", evcnt, this, cpu.TPR.TSR, cpu.TPR.CA, cachedBound,
140 cachedP, cachedAddress, cachedR1, cachedPaged);
141 # endif
142 goto miss;
143 #else
144 if (! ucCacheCheck (cpup, this, cpu.TPR.TSR, cpu.TPR.CA, & bound, & p, & pageAddress, & RSDWH_R1, & paged)) {
145 # if defined(HDBG)
146 hdbgNote ("doAppendCycleOperandRead.h", "miss %d %05o:%06o\r\n", evcnt, cpu.TPR.TSR, cpu.TPR.CA);
147 # endif
148 goto miss;
149 }
150 #endif
151
152 if (paged) {
153 finalAddress = pageAddress + (cpu.TPR.CA & OS18MASK);
154 } else {
155 finalAddress = pageAddress + cpu.TPR.CA;
156 }
157 cpu.RSDWH_R1 = RSDWH_R1;
158
159
160
161 #if defined(HDBG)
162 hdbgNote ("doAppendCycleOperandRead.h", "hit %d %05o:%06o\r\n", evcnt, cpu.TPR.TSR, cpu.TPR.CA);
163 #endif
164
165
166 if (full)
167 set_apu_status (cpup, paged ? apuStatus_FAP : apuStatus_FANP);
168 cpu.apu.lastCycle = OPERAND_READ;
169 goto HI;
170
171
172 skip:;
173
174 # if defined(HDBG)
175 hdbgNote ("doAppendCycleOperandRead.h", "skip %d %05o:%06o\r\n", evcnt, cpu.TPR.TSR, cpu.TPR.CA);
176 # endif
177 # if defined(UCACHE_STATS)
178 cpu.uCache.skips[this] ++;
179 # endif
180
181
182 miss:;
183
184 bool nomatch = true;
185 if (cpu.tweaks.enable_wam) {
186
187
188
189
190
191 nomatch = ((i->opcode == 0232 || i->opcode == 0254 ||
192 i->opcode == 0154 || i->opcode == 0173) &&
193 i->opcodeX ) ||
194 ((i->opcode == 0557 || i->opcode == 0257) &&
195 ! i->opcodeX);
196 }
197
198 processor_cycle_type lastCycle = cpu.apu.lastCycle;
199 cpu.apu.lastCycle = OPERAND_READ;
200
201 DBGAPP ("doAppendCycleOperandRead(Entry) XSF %o\r\n", cpu.cu.XSF);
202
203 PNL (L68_ (cpu.apu.state = 0;))
204
205 cpu.RSDWH_R1 = 0;
206
207 cpu.acvFaults = 0;
208
209
210 #define FMSG(x)
211 FMSG (char * acvFaultsMsg = "<unknown>";)
212
213
214
215
216
217
218
219
220 word3 n = 0;
221
222
223
224
225
226
227
228
229
230
231
232
233 PNL (cpu.APUMemAddr = cpu.TPR.CA;)
234
235 DBGAPP ("doAppendCycleOperandRead(A)\r\n");
236
237
238 if (nomatch || ! fetch_sdw_from_sdwam (cpup, cpu.TPR.TSR)) {
239
240 DBGAPP ("doAppendCycleOperandRead(A):SDW for segment %05o not in SDWAM\r\n", cpu.TPR.TSR);
241 DBGAPP ("doAppendCycleOperandRead(A):DSBR.U=%o\r\n", cpu.DSBR.U);
242
243 if (cpu.DSBR.U == 0) {
244 fetch_dsptw (cpup, cpu.TPR.TSR);
245
246 if (! cpu.PTW0.DF)
247 doFault (FAULT_DF0 + cpu.PTW0.FC, fst_zero, "doAppendCycleOperandRead(A): PTW0.F == 0");
248
249 if (! cpu.PTW0.U)
250 modify_dsptw (cpup, cpu.TPR.TSR);
251
252 fetch_psdw (cpup, cpu.TPR.TSR);
253 } else
254 fetch_nsdw (cpup, cpu.TPR.TSR);
255
256 if (cpu.SDW0.DF == 0) {
257 DBGAPP ("doAppendCycleOperandRead(A): SDW0.F == 0! " "Initiating directed fault\r\n");
258
259 doFault (FAULT_DF0 + cpu.SDW0.FC, fst_zero, "SDW0.F == 0");
260 }
261
262 load_sdwam (cpup, cpu.TPR.TSR, nomatch);
263 }
264 DBGAPP ("doAppendCycleOperandRead(A) R1 %o R2 %o R3 %o E %o\r\n", cpu.SDW->R1, cpu.SDW->R2, cpu.SDW->R3, cpu.SDW->E);
265
266
267 RSDWH_R1 = cpu.RSDWH_R1 = cpu.SDW->R1;
268
269
270
271
272
273
274
275
276
277
278
279 DBGAPP ("doAppendCycleOperandRead(B)\r\n");
280
281
282
283
284 if (! (cpu.SDW->R1 <= cpu.SDW->R2 && cpu.SDW->R2 <= cpu.SDW->R3)) {
285
286 cpu.acvFaults |= ACV0;
287 PNL (L68_ (cpu.apu.state |= apu_FLT;))
288 FMSG (acvFaultsMsg = "acvFaults(B) C(SDW.R1) <= C(SDW.R2) <= " "C(SDW .R3)";)
289 }
290
291
292
293
294
295
296
297 if (lastCycle == RTCD_OPERAND_FETCH)
298 sim_warn ("%s: lastCycle == RTCD_OPERAND_FETCH opcode %0#o\r\n", __func__, i->opcode);
299
300
301
302
303
304
305
306 if (i->info->flags & CALL6_INS)
307 goto E;
308
309
310 if (i->info->flags & TRANSFER_INS)
311 goto F;
312
313
314
315
316
317 DBGAPP ("doAppendCycleOperandRead(B):!STR-OP\r\n");
318
319
320
321 if (cpu.TPR.TRR > cpu.SDW->R2) {
322 DBGAPP ("ACV3\r\n");
323 DBGAPP ("doAppendCycleOperandRead(B) ACV3\r\n");
324
325 cpu.acvFaults |= ACV3;
326 PNL (L68_ (cpu.apu.state |= apu_FLT;))
327 FMSG (acvFaultsMsg = "acvFaults(B) C(TPR.TRR) > C(SDW .R2)";)
328 }
329
330 if (cpu.SDW->R == 0) {
331
332 cpu.TPR.TRR = cpu.PPR.PRR;
333
334
335 if (cpu.PPR.PSR != cpu.TPR.TSR) {
336 DBGAPP ("ACV4\r\n");
337 DBGAPP ("doAppendCycleOperandRead(B) ACV4\r\n");
338
339 cpu.acvFaults |= ACV4;
340 PNL (L68_ (cpu.apu.state |= apu_FLT;))
341 FMSG (acvFaultsMsg = "acvFaults(B) C(PPR.PSR) = C(TPR.TSR)";)
342
343
344 }
345 }
346
347 goto G;
348
349
350
351
352
353
354
355 D:;
356 DBGAPP ("doAppendCycleOperandRead(D)\r\n");
357
358
359
360
361
362 if (cpu.rRALR == 0)
363 goto G;
364
365
366 if (! (cpu.PPR.PRR < cpu.rRALR)) {
367 DBGAPP ("ACV13\r\n");
368 DBGAPP ("acvFaults(D) C(PPR.PRR) %o < RALR %o\r\n", cpu.PPR.PRR, cpu.rRALR);
369 cpu.acvFaults |= ACV13;
370 PNL (L68_ (cpu.apu.state |= apu_FLT;))
371 FMSG (acvFaultsMsg = "acvFaults(D) C(PPR.PRR) < RALR";)
372 }
373
374 goto G;
375
376
377
378
379
380
381
382 E:;
383
384
385
386
387
388
389 DBGAPP ("doAppendCycleOperandRead(E): CALL6\r\n");
390 DBGAPP ("doAppendCycleOperandRead(E): E %o G %o PSR %05o TSR %05o CA %06o " "EB %06o R %o%o%o TRR %o PRR %o\r\n",
391 cpu.SDW->E, cpu.SDW->G, cpu.PPR.PSR, cpu.TPR.TSR, cpu.TPR.CA, cpu.SDW->EB,
392 cpu.SDW->R1, cpu.SDW->R2, cpu.SDW->R3, cpu.TPR.TRR, cpu.PPR.PRR);
393
394
395 if (! cpu.SDW->E) {
396 DBGAPP ("ACV2 b\r\n");
397 DBGAPP ("doAppendCycleOperandRead(E) ACV2\r\n");
398
399 cpu.acvFaults |= ACV2;
400 PNL (L68_ (cpu.apu.state |= apu_FLT;))
401 FMSG (acvFaultsMsg = "acvFaults(E) SDW .E set OFF";)
402 }
403
404
405 if (cpu.SDW->G)
406 goto E1;
407
408
409 if (cpu.PPR.PSR == cpu.TPR.TSR && ! TST_I_ABS)
410 goto E1;
411
412
413
414
415 if (cpu.TPR.CA >= (word18) cpu.SDW->EB) {
416 DBGAPP ("ACV7\r\n");
417 DBGAPP ("doAppendCycleOperandRead(E) ACV7\r\n");
418
419 cpu.acvFaults |= ACV7;
420 PNL (L68_ (cpu.apu.state |= apu_FLT;))
421 FMSG (acvFaultsMsg = "acvFaults(E) TPR.CA4-17 >= SDW.CL";)
422 }
423
424 E1:
425 DBGAPP ("doAppendCycleOperandRead(E1): CALL6 (cont'd)\r\n");
426
427
428 if (cpu.TPR.TRR > cpu.SDW->R3) {
429 DBGAPP ("ACV8\r\n");
430 DBGAPP ("doAppendCycleOperandRead(E) ACV8\r\n");
431
432 cpu.acvFaults |= ACV8;
433 PNL (L68_ (cpu.apu.state |= apu_FLT;))
434 FMSG (acvFaultsMsg = "acvFaults(E1) C(TPR.TRR) > SDW.R3";)
435 }
436
437
438 if (cpu.TPR.TRR < cpu.SDW->R1) {
439 DBGAPP ("ACV9\r\n");
440 DBGAPP ("doAppendCycleOperandRead(E) ACV9\r\n");
441
442 cpu.acvFaults |= ACV9;
443 PNL (L68_ (cpu.apu.state |= apu_FLT;))
444 FMSG (acvFaultsMsg = "acvFaults(E1) C(TPR.TRR) < SDW.R1";)
445 }
446
447
448 if (cpu.TPR.TRR > cpu.PPR.PRR) {
449
450 if (cpu.PPR.PRR < cpu.SDW->R2) {
451 DBGAPP ("ACV10\r\n");
452 DBGAPP ("doAppendCycleOperandRead(E) ACV10\r\n");
453
454 cpu.acvFaults |= ACV10;
455 PNL (L68_ (cpu.apu.state |= apu_FLT;))
456 FMSG (acvFaultsMsg = "acvFaults(E1) C(TPR.TRR) > C(PPR.PRR) && " "C(PPR.PRR) < SDW.R2";)
457 }
458 }
459
460 DBGAPP ("doAppendCycleOperandRead(E1): CALL6 TPR.TRR %o SDW->R2 %o\r\n", cpu.TPR.TRR, cpu.SDW->R2);
461
462
463 if (cpu.TPR.TRR > cpu.SDW->R2) {
464
465 cpu.TPR.TRR = cpu.SDW->R2;
466 }
467
468 DBGAPP ("doAppendCycleOperandRead(E1): CALL6 TPR.TRR %o\r\n", cpu.TPR.TRR);
469
470 goto G;
471
472
473
474
475
476
477
478 F:;
479 PNL (L68_ (cpu.apu.state |= apu_PIAU;))
480 DBGAPP ("doAppendCycleOperandRead(F): transfer or instruction fetch\r\n");
481
482
483
484
485
486
487
488 if (cpu.TPR.TRR < cpu.SDW->R1 || cpu.TPR.TRR > cpu.SDW->R2) {
489 DBGAPP ("ACV1 a/b\r\n");
490 DBGAPP ("acvFaults(F) ACV1 !( C(SDW .R1) %o <= C(TPR.TRR) %o <= C(SDW .R2) %o )\r\n", cpu.SDW->R1, cpu.TPR.TRR, cpu.SDW->R2);
491 cpu.acvFaults |= ACV1;
492 PNL (L68_ (cpu.apu.state |= apu_FLT;))
493 FMSG (acvFaultsMsg = "acvFaults(F) C(TPR.TRR) < C(SDW .R1)";)
494 }
495
496 if (! cpu.SDW->E) {
497 DBGAPP ("ACV2 c\r\n");
498 DBGAPP ("doAppendCycleOperandRead(F) ACV2\r\n");
499 cpu.acvFaults |= ACV2;
500 PNL (L68_ (cpu.apu.state |= apu_FLT;))
501 FMSG (acvFaultsMsg = "acvFaults(F) SDW .E set OFF";)
502 }
503
504
505 if (cpu.PPR.PRR != cpu.TPR.TRR) {
506 DBGAPP ("ACV12\r\n");
507 DBGAPP ("doAppendCycleOperandRead(F) ACV12\r\n");
508
509 cpu.acvFaults |= ACV12;
510 PNL (L68_ (cpu.apu.state |= apu_FLT;))
511 FMSG (acvFaultsMsg = "acvFaults(F) C(PPR.PRR) != C(TPR.TRR)";)
512 }
513
514 goto D;
515
516
517
518
519
520
521
522 G:;
523
524 DBGAPP ("doAppendCycleOperandRead(G)\r\n");
525
526
527 if (((cpu.TPR.CA >> 4) & 037777) > cpu.SDW->BOUND) {
528 DBGAPP ("ACV15\r\n");
529 DBGAPP ("doAppendCycleOperandRead(G) ACV15\r\n");
530 cpu.acvFaults |= ACV15;
531 PNL (L68_ (cpu.apu.state |= apu_FLT;))
532 FMSG (acvFaultsMsg = "acvFaults(G) C(TPR.CA)0,13 > SDW.BOUND";)
533 DBGAPP ("acvFaults(G) C(TPR.CA)0,13 > SDW.BOUND\r\n" " CA %06o CA>>4 & 037777 %06o SDW->BOUND %06o",
534 cpu.TPR.CA, ((cpu.TPR.CA >> 4) & 037777), cpu.SDW->BOUND);
535 }
536 bound = cpu.SDW->BOUND;
537 p = cpu.SDW->P;
538
539 if (cpu.acvFaults) {
540 DBGAPP ("doAppendCycleOperandRead(G) acvFaults\r\n");
541 PNL (L68_ (cpu.apu.state |= apu_FLT;))
542
543 doFault (FAULT_ACV, (_fault_subtype) {.fault_acv_subtype=cpu.acvFaults},
544 "ACV fault");
545 }
546
547
548 if (cpu.SDW->U)
549 goto H;
550
551
552
553
554 DBGAPP ("doAppendCycleOperandRead(G) CA %06o\r\n", cpu.TPR.CA);
555 if (nomatch ||
556 ! fetch_ptw_from_ptwam (cpup, cpu.SDW->POINTER, cpu.TPR.CA)) {
557 fetch_ptw (cpup, cpu.SDW, cpu.TPR.CA);
558 if (! cpu.PTW0.DF) {
559
560 doFault (FAULT_DF0 + cpu.PTW0.FC, (_fault_subtype) {.bits=0},
561 "PTW0.F == 0");
562 }
563 loadPTWAM (cpup, cpu.SDW->POINTER, cpu.TPR.CA, nomatch);
564 }
565
566
567
568
569
570
571 if (i->opcodeX && ((i->opcode & 0770)== 0200|| (i->opcode & 0770) == 0220
572 || (i->opcode & 0770)== 020|| (i->opcode & 0770) == 0300)) {
573 do_ptw2 (cpup, cpu.SDW, cpu.TPR.CA);
574 }
575 goto I;
576
577
578
579
580
581
582
583 H:;
584 DBGAPP ("doAppendCycleOperandRead(H): FANP\r\n");
585
586 paged = false;
587
588 PNL (L68_ (cpu.apu.state |= apu_FANP;))
589
590
591
592
593
594
595
596 set_apu_status (cpup, apuStatus_FANP);
597 #if defined(HDBG)
598 hdbgNote ("doAppendCycleOperandRead", "FANP");
599 #endif
600 DBGAPP ("doAppendCycleOperandRead(H): SDW->ADDR=%08o CA=%06o\r\n",
601 cpu.SDW->ADDR, cpu.TPR.CA);
602
603 pageAddress = (cpu.SDW->ADDR & 077777760);
604 finalAddress = (cpu.SDW->ADDR & 077777760) + cpu.TPR.CA;
605 finalAddress &= 0xffffff;
606 PNL (cpu.APUMemAddr = finalAddress;)
607
608 DBGAPP ("doAppendCycleOperandRead(H:FANP): (%05o:%06o) finalAddress=%08o\r\n",
609 cpu.TPR.TSR, cpu.TPR.CA, finalAddress);
610
611 goto HI;
612
613 I:;
614
615
616
617 DBGAPP ("doAppendCycleOperandRead(I): FAP\r\n");
618
619 paged = true;
620
621 #if defined(HDBG)
622 hdbgNote ("doAppendCycleOperandRead", "FAP");
623 #endif
624
625 set_apu_status (cpup, apuStatus_FAP);
626 PNL (L68_ (cpu.apu.state |= apu_FAP;))
627
628 word24 y2 = cpu.TPR.CA % 1024;
629
630 pageAddress = (((word24)cpu.PTW->ADDR & 0777760) << 6);
631
632
633 finalAddress = (((word24)cpu.PTW->ADDR & 0777760) << 6) + y2;
634 finalAddress &= 0xffffff;
635 PNL (cpu.APUMemAddr = finalAddress;)
636
637 L68_ (
638 if (cpu.MR_cache.emr && cpu.MR_cache.ihr)
639 add_l68_APU_history (cpup, APUH_FAP);
640 )
641
642 DBGAPP ("doAppendCycleOperandRead(H:FAP): (%05o:%06o) finalAddress=%08o\r\n",
643 cpu.TPR.TSR, cpu.TPR.CA, finalAddress);
644
645
646
647 HI:
648 DBGAPP ("doAppendCycleOperandRead(HI)\r\n");
649
650 #if defined(TEST_UCACHE)
651 if (cacheHit) {
652 bool err = false;
653 if (cachedAddress != pageAddress) {
654 sim_printf ("cachedAddress %08o != pageAddress %08o\r\n",
655 cachedAddress, pageAddress);
656 err = true;
657 }
658 if (cachedR1 != RSDWH_R1) {
659 sim_printf ("cachedR1 %01o != RSDWH_R1 %01o\r\n",
660 cachedR1, RSDWH_R1);
661 err = true;
662 }
663 if (cachedBound != bound) {
664 sim_printf ("cachedBound %01o != bound %01o\r\n",
665 cachedBound, bound);
666 err = true;
667 }
668 if (cachedPaged != paged) {
669 sim_printf ("cachedPaged %01o != paged %01o\r\n",
670 cachedPaged, paged);
671 err = true;
672 }
673 if (err) {
674 # if defined(HDBG)
675 HDBGPrint ();
676 # endif
677 sim_printf ("oprnd read err %d %05o:%06o\r\n",
678 evcnt, cpu.TPR.TSR, cpu.TPR.CA);
679 exit (1);
680 }
681
682 # if defined(HDBG)
683 hdbgNote ("doAppendCycleOperandRead.h", "test hit %d %05o:%06o\r\n",
684 evcnt, cpu.TPR.TSR, cpu.TPR.CA);
685 # endif
686 } else {
687
688 # if defined(HDBG)
689 hdbgNote ("doAppendCycleOperandRead.h", "test miss %d %05o:%06o\r\n",
690 evcnt, cpu.TPR.TSR, cpu.TPR.CA);
691 # endif
692 }
693 #endif
694
695 ucCacheSave (cpup, this, cpu.TPR.TSR, cpu.TPR.CA, bound, p, pageAddress, RSDWH_R1, paged);
696 #if defined(TEST_UCACHE)
697 # if defined(HDBG)
698 hdbgNote ("doAppendCycleOperandRead.h", "cache %d %u %05o:%06o %05o %o %08o %o %o",
699 evcnt, this, cpu.TPR.TSR, cpu.TPR.CA, bound, p, pageAddress, RSDWH_R1, paged);
700 # endif
701 #endif
702 evcnt ++;
703
704
705 cpu.cu.XSF = 1;
706 if (full && cpu.currentInstruction.b29)
707 cpu.xsfScu = true;
708 sim_debug (DBG_TRACEEXT, & cpu_dev, "loading of cpu.TPR.TSR sets XSF to 1\r\n");
709
710 if (full)
711 cache_readN (cpup, finalAddress, data, nWords, "OPERAND_READ");
712 else
713 core_readN_fast (cpup, finalAddress, data, nWords, "OPERAND_READ");
714
715 if (i->info->flags & CALL6_INS)
716 goto N;
717
718
719 if (i->info->flags & TRANSFER_INS)
720 goto L;
721
722
723
724 goto Exit;
725
726
727
728
729
730
731
732 L:;
733
734 DBGAPP ("doAppendCycleOperandRead(L)\r\n");
735
736
737 if (i->info->flags & TSPN_INS) {
738 if (i->opcode <= 0273)
739 n = (i->opcode & 3);
740 else
741 n = (i->opcode & 3) + 4;
742
743
744
745
746
747 cpu.PR[n].RNR = cpu.PPR.PRR;
748
749
750 if (get_addr_mode (cpup) == APPEND_mode)
751 cpu.PR[n].SNR = cpu.PPR.PSR;
752 cpu.PR[n].WORDNO = (cpu.PPR.IC + 1) & MASK18;
753 SET_PR_BITNO (n, 0);
754 #if defined(TESTING)
755 HDBGRegPRW (n, "app tspn");
756 #endif
757 }
758
759
760 DBGAPP ("doAppendCycleOperandRead(KL)\r\n");
761
762
763 cpu.PPR.PSR = cpu.TPR.TSR;
764
765 cpu.PPR.IC = cpu.TPR.CA;
766
767
768
769 M:
770 DBGAPP ("doAppendCycleOperandRead(M)\r\n");
771
772
773 if (cpu.TPR.TRR == 0) {
774
775 cpu.PPR.P = p;
776 } else {
777
778 cpu.PPR.P = 0;
779 }
780
781 goto Exit;
782
783 N:
784 DBGAPP ("doAppendCycleOperandRead(N)\r\n");
785
786
787 if (cpu.TPR.TRR == cpu.PPR.PRR) {
788
789 cpu.PR[7].SNR = cpu.PR[6].SNR;
790 DBGAPP ("doAppendCycleOperandRead(N) PR7.SNR = PR6.SNR %05o\r\n", cpu.PR[7].SNR);
791 } else {
792
793 cpu.PR[7].SNR = ((word15) (cpu.DSBR.STACK << 3)) | cpu.TPR.TRR;
794 DBGAPP ("doAppendCycleOperandRead(N) STACK %05o TRR %o\r\n", cpu.DSBR.STACK, cpu.TPR.TRR);
795 DBGAPP ("doAppendCycleOperandRead(N) PR7.SNR = STACK||TRR %05o\r\n", cpu.PR[7].SNR);
796 }
797
798
799 cpu.PR[7].RNR = cpu.TPR.TRR;
800
801 cpu.PR[7].WORDNO = 0;
802
803 SET_PR_BITNO (7, 0);
804 #if defined(TESTING)
805 HDBGRegPRW (7, "app call6");
806 #endif
807
808 cpu.PPR.PRR = cpu.TPR.TRR;
809
810 cpu.PPR.PSR = cpu.TPR.TSR;
811
812 cpu.PPR.IC = cpu.TPR.CA;
813
814 goto M;
815
816 Exit:;
817
818 PNL (cpu.APUDataBusOffset = cpu.TPR.CA;)
819 PNL (cpu.APUDataBusAddr = finalAddress;)
820
821 PNL (L68_ (cpu.apu.state |= apu_FA;))
822
823 DBGAPP ("doAppendCycleOperandRead (Exit) PRR %o PSR %05o P %o IC %06o\r\n", cpu.PPR.PRR, cpu.PPR.PSR, cpu.PPR.P, cpu.PPR.IC);
824 DBGAPP ("doAppendCycleOperandRead (Exit) TRR %o TSR %05o TBR %02o CA %06o\r\n", cpu.TPR.TRR, cpu.TPR.TSR, cpu.TPR.TBR, cpu.TPR.CA);
825
826 return finalAddress;
827 }
828 #undef TEST_UCACHE