As I work my way along the learning curve, the memory data displayed on my PiDP-10 console has been demanding attention. My guess was that it is displaying whatever is going by in terms of memory references, which would explain why it looks a lot like the SOJG instruction in the TOPS-10 null job. That's seems to be what Rich was saying before.
I finally sat down and had a look at ka10_pipanel.c and kx10_cpu.c, confirming my suspicion. Basically, the simulator thread maintains a bunch of PDP-10 registers, including AB (Address Buffer), MB (Memory Buffer), and the Address Switches (AS). MB is getting displayed in the lights, when it's not commandeered by "DATAO PI,xxx" code.
I added a new "register", MBL (Memory Buffer we want in Lights), and display that instead of MB in ka10_pipanel.c, e.g.:
! leds = (((MI_flag)? MI : MBL) & MB_MASK0) >> MB_V_0;
The changed Mem_read_ka() and Mem_write_ka() in kx10_cpu.c to set MBL when that location is referenced with a read or write, e.g.:
*** 4084,4089 ****
--- 4085,4094 ----
if (AB < 020) {
MB = get_reg(AB);
+ #if PIDP10 /* If operator watching this location, show data */
+ if (AS == AB)
+ MBL = MB;
+ #endif
} else {
if (!page_lookup_ka(AB, flag, &addr, mod, cur_context, fetch))
return 1;
***************
*** 4096,4101 ****
--- 4101,4110 ----
watch_stop = 1;
sim_interval--;
MB = M[addr];
+ #if PIDP10 /* If operator watching this location, show data */
+ if (AS == addr)
+ MBL = MB;
+ #endif
}
if (fetch == 0 && hst_lnt) {
hst[hst_p].mb = MB;
***************
That's where the Examine This and Deposit This buttons are handled, so I added support there too:
--- 4502,4513 ----
if (examine_sw) { /* Examine memory switch */
AB = AS;
(void)Mem_read_nopage();
+ MBL = MB;
examine_sw = 0;
}
if (deposit_sw) { /* Deposit memory switch */
AB = AS;
! MBL = MB = SW;
(void)Mem_write_nopage();
deposit_sw = 0;
}
Oops - I forgot the #ifdefs.
And hey - I can see the null job run! And see locations update on the fly if the program accesses them, and Examine This works, and as for Deposit This.... Oh, I can look at OS memory easily with a SPYseg (I can tell a CALLI that I want to see physical memory in my HISEG) The UUO/system call is in location 40, but I see an "AOS 601". I don't recall TOPS-10 counting the number of system calls executed, but 6.03 does. And when did they change the null job? Was I at DEC then?
.debug hello
LINK: Loading
[LNKDEB DDT Execution]
1/ 0 100000
calli 1,42$x
<SKP>
400040/ CALLI 5,@.JB41(17)
400041/ JSR 10730
410730/ CAM 3307
410731/ MOVEM 17,723
410732/ AOS 601
400601/ 2702 ./ 2724 ./ 2746 0 [I should not be able to modify it]
? [Error - I can't]
./ 3005
Yay, now it looks like a PDP-10 should! And I can deposit into 601 safely on the fly.
Over dinner it occurred to me that a neat option might be to display the "virtual" (the user's LOSEG/HISEG) address instead of always displaying the physical address, but that wouldn't be very useful on a busy system. E.g. setting the address switches to 601 could change the display with every context switch, at least if that's a frequently used location in a program. Probably not even worth an experiment. Well, maybe. Not tonight.
I am impressed at the details in the simulation. E.g. I had no idea that /* On KA or KI the AC is stored before Memory */. Heck, what does that even mean? What might POP P,P do? I'm sure I've never tried.
Hey Rich, we need to talk about this getting this into the real code and what else I've missed. I didn't touch the KI/KL/KS code, KI needs it. Well, kinda, sorta. Nor the alternate KAs - ITS, BBN, and WAITS. Do they need it? Probably. I wouldn't think their pager hardware would modify console-related stuff.
-Ric