[The list software objected to this message; I don't know why. Retrying. -- Rich] Date: Tue, 13 Mar 2018 21:13:52 -0400 Subject: Re: [math-fun] History of swap/exch computer instructions ? From: wba <wbackerman@gmail.com> I the early days, many computers used the read-clear and write-to-previously-cleared properties of core memory. To recapitulate how that worked, a memory cycle began by sending a pulse to the core that clears it, while sense amplifiers sense the weak signal telling whether or not the core "turned over". Then the new data was written back by selectively sending pulses to the core in the other direction, setting bits to 1. Even if you only wanted to read, or only wanted to write, you had to do both halves of the cycle, to rewrite what you read, or to pre-clear what you were about to write. These properties were used for "add to memory" types of instructions, as well as various atomic synchronization primitives, such as semaphores. And, of course, for reg<->mem swaps. The atomic synchronization primitives were harder to implement when core memory got replaced by plain RAM. The DEC PDP-1 at the Research Laboratory of Electronics at MIT (a number of correspondents on this list remember that machine) had an interesting application of swapping something with memory. The time-sharing system needed to swap whole memory fields (4096 words!) onto and off of the drum when switching processes. A given field on the drum (one revolution, 4096 bits, 18 fixed tracks) had to be read into core, while the previous contents of core were written to a different 18 tracks. This required a sort of "supraluminal" information transfer. Faster than light? No. Just faster than the drum's rotation. Writing bits onto a track required blasting a powerful pulse from the write amplifiers onto the write heads. The electrical noise from this blast completely overwhelmed the sensitive read amplifiers trying to listen to another track. So they took advantage of the fact that whatever pulse was delivered to the write heads would have its magnetic field sort of smeared out in space, because the heads rode about .001 inches above the surface. Similarly, the read heads would "hear" an average of the smeared out magnetic field of the drum bit going by. So the mechanism would read data from memory, clearing same and holding that memory word open, and then blast that onto the desired write track. Just before the blast occurred, the read heads on the other track could sort of hear the other bit coming. The read amplifiers sensed the yet-to-arrive data just before the blast, and write that back into core.