PDP-8 Code Optimization (was Re: HP-35/45 Simulator for PDP-8)

Vincent Slyngstad v.slyngstad at frontier.com
Wed Sep 14 07:17:20 CDT 2016


From: Kyle Owen: Tuesday, September 13, 2016 7:12 PM
> TAD OVFA /A XOR B
> AND OVFB
> CMA IAC
> TAD OVFA
> TAD OVFB

Sigh.

There seems to be an issue with my implementation of XOR.
Before the CMA IAC there needs to be CLL RAL, to reposition 
the carries before subtracting them.  Both XORs are affected.

Since all we are interested in is the sign of the XOR results, 
only some of the sums end up wrong.  Mostly where both 
operands are negative; there will be a carry out of the sign 
bit when we add them together.

Kyle: I wrote to code to exhaustively enumerate the operand 
space, and some Perl to generate "correct" answers.  Wrote 
the results to simulated paper tape.  With the modification 
described, the 250Mb result files match.  Good thing that 
paper tape was a simulated one :-).

    Vince 


More information about the cctech mailing list