Has Anyone Written PDP-8 .XOR. Code Using the MQ Register (Without the EAE)?
north at alum.mit.edu
Thu Dec 24 01:21:21 CST 2015
On 12/23/2015 10:50 PM, Don North wrote:
> On 12/23/2015 7:14 PM, Christian Gauger-Cosgrove wrote:
>> On 23 December 2015 at 13:44, CLASystems <clasystems at gmail.com> wrote:
>>> Ironically, the shortest and fastest seems to be avoidance of the MQ
>>> altogether [thus making it work on ANY model].
>>> TAD ARGONE
>>> AND ARGTWO
>>> CLL RAL
>>> TAD ARGONE
>>> DCA ARGTWO
>>> This works because .XOR. is addition ignoring the carry bits. So, knowing
>>> they will happen, just allow them at first, then remove them.
>> Hmm, I just tried that in SIMH, and that doesn't XOR at all.
> I think there was just a bit of brain fade in the original listing. From
> DEC-08-FFAA-D PDP-8 Math Library circa 1968
> the XOR routine is as follows, transcribed to SIMH:
> sim> de 76 1234
> sim> de 77 4321
> sim> ie -m 100-107
> 100: CLA CLL
> 101: TAD 76
> 102: AND 77
> 103: CIA
> 104: CLL RAL
> 105: TAD 76
> 106: TAD 77
> 107: HLT
> sim> go 100
> HALT instruction, PC: 00110 (AND 0)
> sim> ex ac
> AC: 5115
> Which produces the correct result in the AC. Locations 103/104 were swapped in
> order, and location 106 was left out.
> And for completeness location 100 was added to initially clear the AC/Link.
FYI here is a link to find the document:
I can't find it under dec/pdp8 on bitsavers, maybe I'm just not seeing it.
More information about the cctalk