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