logoalt Hacker News

GeorgeTirebiter • today at 6:19 PM • 0 replies • view on HN

The way the IBM 1401 does it, because it's a variable word-length machine (fields being delineated by Word Marks, which is a bit in each core location specifically for marking the end of a field / instruction).

So the number '123' is stored in sequential memory locations: x, x+1, x+2 with a word mark under the '1'.

To add (assembly: A X,Y) e.g. '456' to said number at y, y+1, y+2 (in this case the 4 need NOT have a word mark (but usually does) because a word mark in either field ends the operation) the machine starts at the high-order address -- so it starts at address x+2 and y+2, develops any carry, applies that to x+1 and y+1, adds, and finally moves to the hundreds digit, adding any carry from the tens. (The destination address holds the sum in this case, '456' goes to '579')

Also, to move '123' somewhere, you specify the address of the '3' and the field is moved right-to-left to the destination (decrementing the internal pointer, and stopping when finding a word mark).

So, it more or less was Big Endian, but was still able to use a serial ALU by starting at the highest address!