back to article Mature mainframe madness prints Mandlebrot fractal in TWELVE MINUTES

A programmer better known for work on Arduino has shown off handy vintage mainframe skills, getting an ancient IBM 1401 to buzz away on its 1403 line printer to produce the classic Mandelbrot fractal image. It's not as trivial as it sounds. In this blog post on the “12-minute Mandelbrot”, Ken Shirriff explains that programming …

  1. William Donelson

    First truly multi-media computer system in the world:

    http://www.wired.com/2015/01/tech-time-warp-week-1977-tablet-computer-took-entire-room/

  2. Ole Juul

    Still using dot matrix here

    I don't have any mainframe experience, but I do have a love for dot matrix printers. I've got a small collection of good ones, and in fact have one hooked up and turned on most of the time. It works fine for printing out personal stuff, and showing up at the odd meeting with a piece of perforated computer paper does garner a comment or two.

    1. big_D Silver badge

      Re: Still using dot matrix here

      We still regularly buy dot matrix printers for our customers.

      In the slaughter industry, the scales and Fat-o-Meters are often connected to a DMP in order to print the legal protocol. They are slowly being phased out by tamper-proof memory in the devices, but I guess we order a few dozen Epson FX890s every year. But they are getting darned expensive, because they are made in relatively small batches, due to lack of demand.

  3. fedoraman
    Coat

    But will it...

    ... run Crysis?

    1. Fibbles

      Re: But will it...

      Given enough time, anything can run Crysis.

      1. Anonymous Coward
        Anonymous Coward

        Re: But will it...

        not quite anything

        1. Fibbles

          Re: But will it...

          O RLY?

  4. Anonymous Coward
    Anonymous Coward

    Dot Matrix?

    That looks more like the output from a line printer with a failed hammer (Line printer: has a spinning drum with 132 rings of characters and a bank of 132 hammers. In theory it will print a compolete line in one revolution of the drum.)

    1. Phil O'Sophical Silver badge

      Re: Dot Matrix?

      In theory it will print a compolete line in one revolution of the drum.

      And makes a hell of a noise doing it, while throwing paper feet into the air if it wasn't in the guides properly. The band printers were slightly better, just a permanent ripping-calico noise, still way louder than dot-matrix, even they could get through a 2000-page box of fanfold in no time flat.

      When I first saw a high-speed laser printer in action (looked more like an old-style newspaper press) it was truly eerie to hear how quiet it was, despite the paper spewing from the back.

    2. Stoneshop

      Re: Dot Matrix?

      There was a Hewlett-Packard drum printer (back from when HP was still a respected name making well-engineered stuff) that had only 44 rings of characters on its drum, and a matching set of hammers, apparently to save on driver electronics and hammer banks. Printing a full line was achieved by shuffling the paper left and right by way of an excenter crank. This somewhat Rube Goldberg-ish contraption needed three drum rotations per line. The line buffer was implemented using shift registers, one per bit.

      (insert cobwebs.ico)

    3. Jim 59

      Re: Dot Matrix?

      Before about 1987ish, utility bills (phone, water) bore the unmistakable appearance of having been line printed.

  5. Nick

    I was a Burroughs/Unisys man, but surely that printout is from a chain/train printer not a dot-matrix?

    1. tony2heads
      Happy

      chain printer

      Old memories of a thing that sounded like a machine gun (or perhaps a chain gun)

      1. Anonymous Coward
        Anonymous Coward

        Re: chain printer

        It wasn't always machine gun noise. The chain printer attached to a 1401 in the IBM Data Centre in Newman St., London used to play carols at Christmas. Someone wrote a program with the text to print chosen so the hammers hitting the chain produced the right notes. It was quite a credible rendition...

        Also unless my memory isn't what it used to be, assembler didn't seem that hard compared to C++ today!

        1. PhilBuk

          Re: chain printer

          "Also unless my memory isn't what it used to be, assembler didn't seem that hard compared to C++ today!"

          Damn right. A lot easier than writing programs in which most of the statements are compiler directives!

          Phil.

  6. Pen-y-gors

    Dot matrix? Pah!

    Modern stuff!

    Real mainframes used the old line printers, with individual sets of characters on a band that went round and hit the paper like a typewriter letter. From what I remember when we used them on an IBM 370/148 they did about 600 lines per minute. The technology was handy for doing multiple copies as we had lineflo paper with carbon paper interleaved.

    A colleague had worked for the Gas Board as an operator some years before, and one of their people had realised that if you printed certain combinations of characters repeatedly you got different sounds from the printer as the bands vibrated. They then worked on the details, and soon had a set of cards ready which, when run, got the printer to play the National Anthem.

    I believe that was the same colleague who had a problem one day: the bosses were bringing important guests to see their ultra-modern machine room, but complained afterwards that it had been very dull and boring - they were all just sitting around doing nothing. Of course they were actually in the middle of a long billing run, and the numbers were being crunched. So before the next official visit they prepared a program which they ran as soon as the visitors were spotted: it suspended the real job, and then started lights flashing, printer lids going up and down, tapes rewinding and unmounting etc etc. Not exactly productive, but it impressed the hell out of the visitors!

    Ah, the joys of real computers!

    1. Anonymous Coward
      Anonymous Coward

      Re: Dot matrix? Pah!

      One nice thing about working on billing system for the Gas Board - your work could be made famous by the popular Sunday night consumer affairs show "That's Life".

      As I recall, they had regular features about how rubbish computers were, usually because a pensioner had received a gas bill for 2 million quid or whatever.

    2. Sarah Balfour

      Re: Dot matrix? Pah!

      @Pen-y-gors The national anthem…?! Pah! Kids stuff! Prepare to have your mind blown…

      https://youtu.be/u8I6qt_Z0Cg

      Krauts are Krazy - and I wanna know how they do it! Check out the rest of their channel, too, their latest 'release' is the Who Wants To Be A Millionaire? theme.

      If that link doesn't work, search YT for 'MIDI Desaster'.

    3. Tom 38

      Re: Dot matrix? Pah!

      My uni was bought out by the borg, all of our CS department had sponsored Dell-Windows kit. The one redeeming aspect was that they took the less decrepit old hardware and gave us a "linux lab", with a daisywheel line printer that was free to use from linux (compared to 10p a page for any other printer). I still have several of the more useful RFCs I spent hours printing out on it...

    4. Pet Peeve

      Re: Dot matrix? Pah!

      You're exactly right - standard equipment for a 1401 was a 1403 line printer.

      In the early 80s, I worked as a computer operator for about a year - the dinosaur pen had a row of IBM 360/50s, and a bunch of shared devices like tape drives and 3 line printers (not 1403s, a later and even faster model). There is no question that I did permanent damage to my hearing when I ran the printer with the cover up. I don't even remember WHY I would do that - the dang thing spit paper so fast that you couldn't really yank printouts without pausing it. The noise is really indescribable.

      One of the fun things the printer had was a "carriage control band" - this was a paper loop that went over two sprockets, and programs could do a form skip to a specific spot on the page, which was nice for printing on forms, or to put the page totals in the same spot on each page without having the program have to count and skip individual lines. If you installed the wrong band, or didn't line it up right, or it slipped off, the printer would yank paper through the tractors so fast that it would fountain up into the air, and it would usually empty an entire box (I want to say 2000 pages but I don't remember) in just a minute or so - you never really wanted to turn your back on the things.

  7. Mondo the Magnificent

    Zzzzzzzzzt!

    Ah, my early days in the pre-Windows era of IT! Mainframes!

    I remember how the programmers used to carefully write code to facilitate the oh, so limited memory these oversized, basement situated systems used..

    We had a room dedicated to our noisy band printers and dot matrix printers, which were connected via Centronics or Serial (RS232/422) interfaces.

    I recall getting ASCII art on 1200ft reel tape and printing it, whoop! Dot matrix art of a Manga-esque girlie in a bikini...

    Life was so simple back then... when multimedia was using a Walkman while in the computer room and gaming was trying to beat the mainframe at "hangman" and "tic-tac-toe"

    1. GlenP Silver badge

      Re: Zzzzzzzzzt!

      I still had a tape reel of ASCII art until relatively recently. Think it finally went when I moved house 3 years or so ago. As I'd not had anything with a tape drive since leaving a previous job (with an ageing AS/400) nearly 15 years before there didn't seem much point in keeping it.

      Glen

    2. I ain't Spartacus Gold badge
      Mushroom

      Re: Zzzzzzzzzt!

      Life was so simple back then... when multimedia was using a Walkman while in the computer room and gaming was trying to beat the mainframe at "hangman" and "tic-tac-toe"

      Well you say that. But I found that life soon stopped being simple, when I eschewed the pleasures of Hangman or chess, and decided to play Global Thermonuclear War...

    3. big_D Silver badge

      Re: Zzzzzzzzzt!

      I used to play Star Trek on the VAX 11/750.

    4. Tom Sparrow

      Re: Zzzzzzzzzt!

      Would that not have been EBCDIC Art, or was that earlier still?

  8. Anonymous Coward
    Anonymous Coward

    Did this....

    ... on a ZX Spectrum in BASIC in the 80s. Took over a day to render. Square root of minus 1 for the win.

    1. Richard Taylor 2
      Happy

      Re: Did this....

      pahh i accept your spectrum and offer a ZX80 (although with a dodgy memory pack)

      1. Richard Taylor 2

        Re: Did this....

        it just took a couple of crashes to complete

    2. Irongut

      Re: Did this....

      Your code can't have been very good, my Spectrum version took 16 hours.

      I used to rewrite my old Spectrum Mandelbrot program for every new system / language I worked on. It was impressivley fast on one of those Casio graph calculators and incredibly slow in Visual Basic v1 on a 386.

      1. Anonymous Coward
        Anonymous Coward

        Re: Did this....

        Same here....Just getting it sorted in javascript and rendering in 3d using Babylon - a wrapper around webGL.

        Sub-second rendering times. How times have changed.

        The next step is to convert the mandlebrot code to work as a shader algorithm so that the graphics hardware can do the maths.

    3. Simon Harris

      Re: Did this....

      You did it in BASIC?

      I did it in 6502 assembly code on my Atom, sending the output directly to an Epson LX80, with different grey scales representing different divergence rates to infinity, leaving it chuntering away overnight and the next day, and then reassembling the pages to make poster sized Mandelbrot and Julia set images.

      Did it again a few years later in 386/387 assembly code, and what used to take all night to create one image ran as an animation with changing Julia set parameters.

  9. iyengar

    Not Dot Matrix...

    1401 had a 1403 chain printer. As far as I recall it printed at 600 lines a minute. 132 characters wide.

    1. Mike Flex

      Re: Not Dot Matrix...

      "1401 had a 1403 chain printer."

      Indeed. It's even shown in the blogpost linked from the article. More details of the 1403 on Wikipedia.

    2. Catterbutts

      Re: Not Dot Matrix...

      Depending on model the 1403 printer could achieve 1100 lpm (and throw blank paper out at a speed that had a real danger of causing friction fire!).

      We (local Electricity Board) were using a 1401 in 1965 as a slave machine to spool bills, final notices & meter sheets 4 times a year for 2.5 million accounts. (From spool tapes produced by the 100k character memory 1410 mainframe). The throughput of the two 1403s was so great that we employed junior operators just to stand behind the printers ready to change boxes of fanfold stationery as soon as they emptied.

      1. Lars Silver badge
        Happy

        Re: Not Dot Matrix...

        @ Catterbutts

        I visited a customer, a bank's data center, all IBM and with all that came with it, like raised floors and the like. Around 73 I think. There was one of those "drum" printers, from the printer's last pages of paper there was a string tied to the leg of an operator sitting at his desk warning him about paper out slightly in advance. Hightech, who cares.

        Looking at the printout it's very easy to see what kind of printer was used. If the character jump up and down on the line it's made on one of those drums.

        The first laser printers where huge too in those years.

  10. A Non e-mouse Silver badge
    Pint

    Complex Sums

    Calculating the Mandlebrot Set involves dealing with complex numbers. A beer, or three, for anyone who cares to tackle complex numbers in assembler, regardless of how old the machine is.

    1. Richard Taylor 2
      Thumb Down

      Re: Complex Sums

      Complex does not mean complcated.... if you can do integers and fp in assembler you can represent 'complex' numbers. Read up m'boy.

      1. phil dude
        Joke

        Re: Complex Sums

        @Richard Taylor 2: Your statement deserves 0001 0000 0000 upvotes.

        Seriously though, computer arithmetic is a very interesting subject when you see where approximations are made, and how errors can propagate.

        Integers can be used for many assumed floating operations that do not change scale. e.g. molecular distance calculations. However, often the hardware is optimised for approximate fixed point calculations, and double precision is a tragedy in GPU computing....

        P.

  11. Carl W

    Ken Sheriff

    Was also one of the authors of Fractint

    1. Anonymous Coward
      Anonymous Coward

      Re: Ken Sheriff

      Fractint...now there's a word I haven't heard for many, many years.

      Getting slightly dewy-eyed for the "good old days"...which sometimes weren't that good actually.

  12. Christoph

    Reminds me of the story of a machine at a certain Establishment in Berkshire that was programmed to run Space Invaders.

    It printed out a screen in ASCII (or EBCDIC?) characters, waited for user input of Left, Right or Fire, then printed the next screen.

    As immortalised in Dave Langford's "The Leaky Establishment" - but taken from an actual event.

  13. Phil O'Sophical Silver badge

    Sheriff?

    Ken Shirriff, surely? Also known for his reverse-engineered Sinclair Scientific, see his blog at http://www.righto.com/

  14. JavaIsMyPoison

    A real hacker would have given us some dot-matrix pr0n...

  15. Queeg

    Punched Cards

    God, that takes me back.......I remember debugging a print run for The Mona Lisa.

    Trays and trays of the things.

    I had a LOT of patience then.

  16. Andy The Hat Silver badge

    I remember a 5-line piece of BASIC to generate the set ... ran on a BBC micro I believe.

    I used Fractint as a performance benchmark for some years - I had a 3.5" floppy with speeds of machines scrawled on the label (initially straight then the writing filled gaps up the side :-) ) starting with an 80186 and finishing at something like the second generation Pentium.

  17. Primus Secundus Tertius

    Pi in the, er, print

    The IBM 1620 I once programmed used binary coded decimal arithmetic. That meant one could manipulate very long numbers. I used it to calculate pi to 300 places.

    Part of that calculation involved finding the square root of three to 300 places, which entailed a loop in which a 600 place number was divided by a 300 place number. A single hardware divide instruction took about one second to do that, as shown by the flashing lights.

    The real use of BCD is in finance, to represent billions of dollars to the nearest cent without rounding errors for simple addition and subtraction. Percentages and currency conversions still have to be rounded, of course. VAX computers included BCD instructions for use with their COBOL compilers and variables of type COMPUTATIONAL.

    Nowadays this long-length arithmetic would be useful for cryptography.

    1. Kubla Cant

      Re: Pi in the, er, print

      Indeed. The VAX had the usual integer and float types, plus BCD, which, if I remember correctly, stores two decimal digits per byte, plus zoned decimal, which is essentially ASCII, one decimal character per byte with a sign bit added to the least significant digit. Zoned decimals were much used in the DIBOL language.

      I'm also reasonably sure that I remember using BCD on a 16-bit microprocessor, but I can't recall which one. There must have been some kind of support for BCD for me to have thought of using it.

      1. Anonymous Coward
        Anonymous Coward

        The 6502 had a decimal mode

        So I expect several 16-bit processors did. Though arguably the 6502 was a 16-bit processor, seeing as it used 16-bit addresses.

        1. Simon Harris

          Re: The 6502 had a decimal mode

          Just about every usual description of a CPU will say the 6502 is an 8 bit processor.

          While the 6502 did have a BCD mode, it only affected two instructions ADC and SBC (add/subtract with carry) - things like INC and . Many other CPUs (e.g. 6800, 6809, 8080, 80x86, Z80) have a 'decimal adjust accumulator' (DAA) type instruction where, if you want to do BCD arithmetic, you do it in normal binary mode and then do a 'DAA' to fix up the BCD result and carry/overflow flags.

    2. Anonymous Coward
      Anonymous Coward

      Re: Pi in the, er, print

      Why would BCD help you "represent billions of dollars to the nearest cent without rounding errors for simple addition and subtraction"? Any fixed-point representation (binary, decimal, duodecimal or whatever) would avoid rounding errors for addition and subtraction. If you also want to avoid overflow then you need arbitrary precision integers, and if you need exact division then you need a proper implementation of rational numbers, but a 64-bit signed integer (or a long long in C) representing a number of cents takes you up to 92233 billions of dollars even if you use proper European billions.

      1. Wilseus

        Re: Pi in the, er, print

        'Why would BCD help you "represent billions of dollars to the nearest cent without rounding errors for simple addition and subtraction"?'

        I'm not sure that it does. But it does make it a damn sight easier to print out the resulting numbers on a display because many CPUs of the time didn't have a divide instruction. It's trivial to divide by 10 in BCD.

      2. Primus Secundus Tertius

        Re: Pi in the, er, print

        Why use BCD?

        Answer, there were no 64-bit computers in those days. Few people had a 60-bit CDC6600.

        24-bit was common, allowing +or- 8 million. 36 bit would give +or- 32 billion.

        What we did have were COBOL compilers allowing very large numbers to be specified. But to compute them efficiently BCD was the way.

    3. Michael Wojcik Silver badge

      Re: Pi in the, er, print

      Nowadays this long-length arithmetic would be useful for cryptography.

      Not really. The bignum arithmetic algorithms used for modern cryptography are much more efficient than BCD. Modern crypto typically uses the faster variations on the Karatsuba algorithm for multiplication, for example. And with modern crypto you're often doing arithmetic in a Galois field and more complex algebraic structures, where BCD would only get in the way. (People are always publishing new arithmetic algorithms for cryptographic math.)

      For fast large-range arithmetic you don't want BCD anyway. BCD wasn't designed for speed; it was designed to represent radix-10 numbers exactly, primarily to avoid rounding modes that didn't match the pencil-and-paper arithmetic business computers were trying to replace. In some cases that was necessary for legal reasons; in others it was necessary to keep an organization's accounts consistent.

      Even simple fixed-point large-range pure-binary representation should outperform BCD on a modern system with binary ALUs. Even if a system has both binary and BCD ALUs, binary's denser format provides better locality of reference.

  18. This post has been deleted by its author

  19. Peter Simpson 1
    Windows

    Drum, chain, band or bars

    While the two most popular were drum or chain, described above, band printers (cheap chain) had a steel band with the letters impressed into it, very much like a steel credit card.

    And IBM, always looking for an opportunity to make money from old hardware, once offered a printer for the 1130 (1401's baby brother) which was the print unit recycled from a 407 accounting machine. It had a bar for each column, with all the characters on it. Bar was raised to whatever height was needed to print the character. It wasn't very fast.

    1. Mike 16

      Re: Drum, chain, band or bars

      Pedantry alert, two points:

      1) The IBM 1443 can be added to your taxonomy, as it was sort of an oscillating comb printer. Picture a comb with glyphs on the side of the teeth, use logic like a 1403, but instead of rotating in one direction, the comb shuttles first left to right, then right to left. More complex controller logic, but transistor were getting cheaper, type-chains not so much. (And yes, I remember those embossed metal credit cards)

      2) The 407 (and 1132 printer) used type wheels, not bars. You are thinking of the 403. An 1132 running full tilt sounded like a hopped-up band of tambourine players.

  20. earl grey
    Boffin

    ah, the old days

    The chain segments had 2 letters per, if i recall correctly; and the bands just had all the letters punched into them and you replaced the whole band at once; no repairs possible. Chains were lifted out with a handle on each end and could then be benched and worked upon. Unisys 1004 and 1005 used a solid metal drum with raised letters/numbers and was heavier than sin.

  21. Anonymous Coward
    Anonymous Coward

    1401 Autocoder

    Having worked on an IBM 1401 many years ago. The assembly language was called 1401 Autocoder. The machines were tiny compared with modern computers. I worked on a 4K machine which was later upgraded to a maximum of 16K.

    The printer as has been already mentioned was the 1403.The early models were a chain and the later models were a train (ie the pairs of characters were not connected but ran in a slot in the carriage). The advantage of the chain or belt printer was that the lines were always straight, but sometimes the character spacing was a little out. The carriage control tape was used like a tab to skip to a pre-punched hole in the tape. This allowed fast skipping over the page - particularly useful on pe-printed forms like cheques. But if the wrong tape was used and you skipped to a non-existant hole you could empty a whole box of paper in no time. Not too popular with the operators!

  22. Herby

    Dot Matrix??

    Wimps. Any good programmer from the 60's knows that full formed characters are much better. The 1403 used a nice chain that had several alphabets in total. If you used lower case, there were fewer, and the printer ran slower as a result.

    The 1403 also had an automatic lid that would rise up when the printer needed to be fed (paper). One learned very early NOT to put coffee cups on the surfaces of the printer lest you liked mopping up spillage.

    Me? I've got a 300 LPM band printer ans several daisy wheel printers in varying states of working. Nothing beats the sound of a nice working band/chain printer.

  23. John Klos

    Wow... That's actually much faster than doing a 1 bit Mandelbrot set on a Sinclair ZX81:

    https://www.ziaspace.com/~john/mandelbrot.jpg

  24. Anonymous Coward
    Anonymous Coward

    extra instructions for $ ?

    "Shiriff recalls that options available over the base lease price of the system let customers buy extra instructions – for example to move records, store registers, and use index registers."

    Oh $deity! Please - no-one tell Larry !!!!

  25. Long John Brass
    Coffee/keyboard

    I remember a time ...

    When as a PFY, I was handed a bottle of iso-prop, a toothbrush & a jewellers screwdriver to clean a second hand DEC drum printer we had acquired second hand.

    My job was to use said toothbrush, jewellers screwdriver & iso-prop to clean the decade old remnants of printer ribbon & paper dust that had caked up the print drum to the point where it only printed letter-ish smudges.

    I emerged many hours later from the computer hall looking very much like a giant smurf; but the printer was sparkly clean & worked a treat :)

POST COMMENT House rules

Not a member of The Register? Create a new account here.

  • Enter your comment

  • Add an icon

Anonymous cowards cannot choose their icon

Other stories you might like