Recreating SOAP 2 Source and Object

From IBM publication 32-7646-1 "SOAP II for the IBM 650 Data Processing System"[1], I hand entered both the source statements and the 7-word object deck. 

Next, I verified the 7-word object deck by comparing a reading by voice synthesis with the original. I improved the audibility of the reading by first running the object deck through a small utility that added punctuation.

I then wrote a program equivalent to SOAP 2 in C++ that included a command line switch to compare the generated object code with a 7-word object deck.

Because SOAP 2 allocates operand and instruction locations according to an optimization algorithm, both the generated object code and its assigned location must be correct. This required that the optimization algorithm in my C++ code match the original in SOAP 2 exactly.

Running the SOAP 2 source through my C++ code did not produce matching object code. Surely there were typos, but eliminating them did not improve object. The optimization algorithm in my code appeared to be working correctly. 

The problem turned out to be that some statements in the published listing were presented out of order. This may be the result of the author arranging the statements prior to assembly for optimal placement, and rearranging them for clarity. This reordering occurs in the main processing loop, symbol table lookup, and optimum location lookup and reservation.

Another problem resulted from a patch made to the optimization table entries for the MPY and DIV instructions. It appears that the distributed SOAP 2 was assembled with a version of SOAP 2 that reversed the odd/even I optimization constants. The SOAP 2 listing and 7-word deck are corrected in [1].