PDP-8 GTF question
Brian L. Stuart
blstuart at bellsouth.net
Mon Jul 27 10:00:39 CDT 2015
> To Stuart - are you sure your code does it right. Could you post it?
That's kind of what got me here. I was running the 8E-D1HA
maindec on my emulator and it was failing at that point. My
initial reaction was that I was misinterpreting the RTF behavior
and that perhaps it wasn't setting the interrupt inhibit as I
had thought. So I ran the diag on the real thing and single
stepped through that part. Sure enough the RTF does set it,
but GTF seems to not report it. That's when I got confused
enough to break down and look at other people's code :)
Here's my code for both the RTF and GTF instructions. Caveat:
it's in MCPL, but it should be close enough to C that it'll be
recognizable what's going on:
: 0, 0, 4 => // GTF
ac := link << 11 | irq() << 9 | ie << 7 | sf
// ac := link << 11 | irq() << 9 | ii << 8 | ie << 7 | sf
: 0, 0, 5 => // RTF
ie := 1
ii := 1
link := ac >> 11
ub := (ac >> 6) & #o1
ib := (ac >> 3) & #o7
df := ac & #o7
The line that's commented out on the GTF is the original version
I had where I did include the interrupt inhibit.
For comparison, here's the version in simh:
case 4: /* GTF */
LAC = (LAC & 010000) |
((LAC & 010000) >> 1) | (gtf << 10) |
(((int_req & INT_ALL) != 0) << 9) |
(((int_req & INT_ION) != 0) << 7) | SF;
break;
case 5: /* RTF */
gtf = ((LAC & 02000) >> 10);
UB = (LAC & 0100) >> 6;
IB = (LAC & 0070) << 9;
DF = (LAC & 0007) << 12;
LAC = ((LAC & 04000) << 1) | iot_data;
int_req = (int_req | INT_ION) & ~INT_NO_CIF_PENDING;
break;
and the one in Doug Jones' emulator:
case 04: /* GTF */
ac = (link >> 1) /* bit 0 */
#ifdef KE8E
| (gt?) /* bit 1 */
#endif
| ((irq > 0) << 9) /* bit 2 */
#ifdef KM8E
| (0) /*?*/ /* bit 3 */
#endif
| (enab << 7) /* bit 4 */
#ifdef KM8E
| sf /* bit 5-11 */
#endif
;
break;
case 05: /* RTF */
link = (ac<<1)& 010000; /* bit 0 */
#ifdef KE8E
gt = ? /* bit 1 */
#endif
/* nothing */ /* bit 2 */
/* nothing */ /* bit 3 */
enab = 1; /* bit 4 */
#ifdef KM8E
ub = (ac & 00100) >> 6; /* bit 5 */
ib = (ac & 00070) << 9; /* bit 6-8 */
dfr = (ac & 00007) << 12;/* bit 9-11 */
#endif
/* disable interrupts until branch */
enab_rtf = 0;
break;
BLS
More information about the cctech
mailing list