On Tue, 2021-08-24 at 01:38 +0100, Tom Stepleton via cctalk wrote:
For the sake of illustration to folks who are not
necessarily used to
thinking about what computers do at the machine code level, I'm
interested
in collecting examples of single instructions for any CPU
architecture that
are unusually prolific in one way or another.
IBM 1401 was a character-by-character machine, so most operations had
costs proportional to field length.
One especially expensive (but very useful) operation was "move
characters and edit."
Assuming a 17-character control word has been loaded to the
destination, e.g.
"$ ? , ?0. &CR&**"
to edit a data field "00257426" with a "negative" zone bit on the
low-
order digit, producing
"$ ?2,574.26 CR **"
requires 41 memory accesses (including seven to fetch the instruction)
-- 0.4715 milliseconds.
See pages 41-43
at?http://www.bitsavers.org/pdf/ibm/1401/A24-1403-5_1401_Reference_Apr62.pdf
On a machine where ?the "Expanded Print Edit Feature" was added, the
instruction cost even more. For example, the "Floating Dollar Sign"
moves the dollar sign to immediately to the left of the most
significant digit. This (and asterisk protection) was to prevent
somebody from adding digits between a left-justified dollar sign and
leading digits on printed checks. The above edit would cost two more
memory cycles. If the datum had had more leading zeroes, even more
cycles would have been required.
See pages 82-84.
Another expensive instruction was the simpler "move characters and
suppress zeros" instruction. See page 38.