Re: Undefined array elements



On Mon, 29 Aug 2005 11:32:34 -0400, Bob Lidral <l1dralspamba1t@xxxxxxxxxxx>
wrote in <L92dnZDdh-hDt47eRVn-sg@xxxxxxxxxxx>:
> Dr Ivan D. Reid wrote:
>> On Tue, 23 Aug 2005 20:19:31 GMT, Gordon Sande <g.sande@xxxxxxxxxxxxxxxx>
>> wrote in <2005082317193116807%gsande@worldnetattnet>:

>>>The machine which was being described did not have fixed point
>>>as integers were just unnormalized floats if I have the CDC
>>>architecture correctly in mind. Thus 48 bit integers on a 60 bit
>>>machine with the most curious integer overflow semantics. ;-)

>> Ah! *THAT* might explain the contortions I had to go through to
>> get five 12-bit integer bytes into one CDC word so as to get 8-bit
>> paper-tape output from a cross-assembler, to load into a National SC/MP
>> microprocessor.

> I'm not sure why you needed to get 5 12-bit "bytes" into a 60-bit word;
> the CDC CYBERs used 6-bit characters packed 10 to a word. However, the
> Peripheral Processors (PPs) which did all the I/O and in which much of
> the operating system executed, were 12-bit machines (except that their
> accumulator register was 18 bits). Data was transferred in 12-bit
> chunks while the CPU used 18-bit addresses (well, until extended memory
> was added increasing the address space to 21- and/or 24-bit
> addressability, I forget which). So the machine used to pack and unpack
> 12-bit fields to and from 60 bit words. This required the PPs to do
> multiplication and division by 5; multiply-by-5 was relatively easy
> (shift and add) but divide-by-five without a loop on a 12-bit machine
> (with 18-bit accumulator) without a division instruction was challenging
> (and extremely cleverly done).

> But all of that was usually hidden from the users so I'm not sure why
> you had to be aware of it. Unless you were converting 8-bit characters
> to 12-bit before packing them into a 60-bit word? In any case, packing
> 12-bit bytes into a 60-bit CDC word using CDC's FORTRAN shouldn't have
> been very difficult (use shift-and-add or shift-and-or -- CDC FORTRAN
> had shift operations) -- unless you tried to do it using multiply-and-add?

Much of what you say rings true. I made various incremental
discoveries along the way of trying to get a National Semiconductor
cross-assembler running on the Adelaide Cyber to produce 8-hole paper tape
to load into the SC/MP development system where it was blown into EPROMS
to be used in the final hardware. Most of the solutions were found by
poring through the FORTRAN manual and probably some OS manuals -- the
consulting staff were at a total loss. I found out about the 12-bit
output and that I had to pad the 8-bit binary code into those bytes. Then
there was the fact that multiplication only worked up to 48 bits so I had
to use successive adds to shift the first four bytes along to add in the
fifth. Then the output would mysteriously die mid-tape, and after some
puzzling I discovered that an all-zero 12-bit byte was taken as
end-of-file (IIRC, or was it two in succession?) so I changed to making
the four MSBs in each byte all ones so that NULLs weren't misinterpreted as
EOF. ...and then it ran happily ever after and my development of software
for the Mawson Antarctic Interferometer became much easier (I'd done the
periscope control by hand, including keying in the code; coding the other
three processors was much quicker even though they were considerably more
complicated).

--
Ivan Reid, Electronic & Computer Engineering, ___ CMS Collaboration,
Brunel University. Ivan.Reid@[brunel.ac.uk|cern.ch] Room 40-1-B12, CERN
KotPT -- "for stupidity above and beyond the call of duty".
.