Has Anyone Written PDP-8 .XOR. Code Using the MQ Register (Without the EAE)?

dwight dkelvey at hotmail.com
Thu Dec 24 01:02:23 CST 2015


Ok, I think I get it
The acc is one value. Both arg1 and agr0 are init to the second value ( start the same )
I'm not sure how to save a value to the acc on a pdp-8. I know how on my Nicolet 1080
that has a similar ALU.
On my Nicolet:


MEMA ARG0
A+MM ARG0
ANDAM ARG1
A+MA ARG1
ANGA
A+MAM ARG0 ( acc and ARG0 have the xor of the original ARG0 and ARG1 )

I suspect it is similar on a pdp-8 as they have similar ALUs

Dwight


________________________________________
From: cctalk <cctalk-bounces at classiccmp.org> on behalf of dwight <dkelvey at hotmail.com>
Sent: Wednesday, December 23, 2015 10:38 PM
To: General Discussion: On-Topic and Off-Topic Posts
Subject: Re: Has Anyone Written PDP-8 .XOR. Code Using the MQ Register (Without the EAE)?

I'm not sure how to code it on the machine but I know
how to do it.
Take A AND B = C
2* C = D ( ignore carry )
negate D  ( complement and add 1 )
A + B  = E  ( this could have been done first )
E + D = A XOR B
I think it needs 3 variables?
It works because the carries are the result of the AND of the times 2 ( his RAL )
negating and subtracting is what he want to do, leaving the XOR.
Dwight


________________________________________
From: cctalk <cctalk-bounces at classiccmp.org> on behalf of Christian Gauger-Cosgrove <captainkirk359 at gmail.com>
Sent: Wednesday, December 23, 2015 7:14 PM
To: CLASystems at gmail.com; General Discussion: On-Topic and Off-Topic Posts
Subject: Re: Has Anyone Written PDP-8 .XOR. Code Using the MQ Register (Without the EAE)?

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
>     CIA
>     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 haven't
a clue what it does.

What I have entered:
sim> ie -m 100-105
100:    TAD 76
101:    AND 77
102:    CLL RAL
103:    CIA
104:    TAD 76
105:    DCA 77

Locations 076 and 077 being ARGONE and ARGTWO respectively, at the start:
sim> ie 076-077
76:     1234
77:     4321

After running the above code sample:
sim> ie 076-077
76:     1234
77:     0574

If we "flip" ARGONE and ARGTWO's values (to 4321 and 1234 respectively):
sim> ie 076-077
76:     4321
77:     3661

Neither of those is the expected 5115 of an XOR operation.

Am I missing something blindingly obvious?


Cheers,
Christian
--
Christian M. Gauger-Cosgrove
STCKON08DS0
Contact information available upon request.


More information about the cctech mailing list