Skip to content
Nakazoto edited this page Nov 7, 2023 · 27 revisions

Hellorld! on Mainframes and Minicomputers

This is a page dedicated to "Hellorld!" running on large scale systems. What exactly classifies a computer as a "minicomputer" vs. a a "mainframe" is sometimes a little blurry, but in general, we're focusing on large scale systems. Entries are in alphabetical order.

Quick links:

MERA-400 PDP-10 PDP-12 SEL-810A

MERA-400

The MERA-400 is a 16-bit Polish minicomputer from the mid 70s. See here for more details and here for some pictures.

Below is the assembly code for a simple "HELLORLD!" written in ASSM syntax - this is the original MERA-400 assembler:

PROG*
 DEV=15/14+3/10.
 OU,2(DEV+16/4)
 C.C.C.
C:
 LW,1(HELLO)
 SLZ,1.
 LWT,2,0.
LOOP:
 LB,2,1.
 CWT,2,0.
 JES,END.
EN:
 OU,2(DEV+24/4)
 ERR.EN.OK.
ERR:
 HLT,1.
OK:
 AWT,1,1.
 UJS,LOOP.
END:
 HLT,0.
HELLO:
 TEXT*0.
 "HELLORLD!".
FINPROG*

The same code for a modern emas cross-assembler looks like this (a bit more readable and with some comments):

        .equ    DEV 15\14 + 3\10        ; terminal is connected to port 3 on I/O channel 15
        ou      r2, DEV + 16\4          ; send "reset" I/O command to the terminal
        .word   c, c, c
c:
        lw      r1, hello               ; load address of "HELLORLD!" string to r1
        slz     r1                      ; shift r1 left (in preparation for byte addressing)
        lwt     r2, 0                   ; clear r2
loop:
        lb      r2, r1                  ; load byte at the address stored in r1 into r2
        cwt     r2, 0                   ; is it 0?
        jes     end                     ; if it is, jump to "end"
en:
        ou      r2, DEV + 24\4          ; send byte stored in r2 to the terminal
        .word   err, en, ok
err:
        hlt     1                       ; if the terminal controller doesn't respond - halt
ok:
        awt     r1, 1                   ; move pointer to the next letter
        ujs     loop                    ; loop over
end:
        hlt     0                       ; halt
hello:
        .asciiz "HELLORLD!"

Since I don't have an operating system running on my machine, code has been cross-assembled and its hexdump has been entered manually word by word using the control panel, as shown in the video. Thus the code runs on a "naked machine", as they called it back then. :-)

Finally, this is the result of "HELLORLD!" running on MERA-400 with a MERA 7953N terminal connected:

PDP-10

The PDP-10 is a 36-bit mainframe class machine from 1966. Early models were fully transistorized and built using logic modules called flip-chips, making the PDP-10 is the very definition of "large-scale." The PDP-10 architecture is very similar to the preceding PDP-6, just with a slightly expanded instruction set. Later models of the PDP-10, such as the KS10, evolved to use ICs, including the venerable AM-2901 bit-slice ALU. Suzuran, over on the RTC Discord happens to have a DECSystem 2020, which is an evolution of the PDP-10 hailing from 1977 running the TOPS-20 operating system. One day sitting at the machine, they found themselves asking the most important question in programming: "Will it Hellorld!"

You bet your bottom dollar it will!

Check out this link for a video of it running!

Code:

1000   ILDB 0,1010        ; Increment the byte pointer at 1010, then use it to get nine bits in AC 0.
                          ; The rest of the word will be zeroed. The ninth bit is the "Character Pending" flag for the 8080.
1001   SKIPN 0            ; Skip if AC 0 is not zero
1002   JRST 0,DDT         ; Jump to DDT's entry point. "DDT" is a symbol that DDT knows about (it goes to 774000)
1003   MOVEM 0,33         ; Move the character and flag to the console output status word in the 8080 mailbox
1004   CONO APR,12000     ; Set the processor condition bits to ring the 8080's doorbell
1005   SKIPE 33           ; Skip the next instruction if the 8080 has zeroed the console output status word.
1006   JRST 1005          ; Otherwise wait, the 8080 will zero the word when it is done printing on the CTY.
1007   JRST 1000          ; Jump back to 1000

1010   001100,,001010     ; Location 1010 has the byte pointer. It describes a string of nine-bit bytes
                          ; starting at bit 0 of this word. Since our first operation increments this,
                          ; the actual first character comes from bit 9 of the next word.
                          ; Each byte has the high-order bit set, as described earlier
1011   510505,,514514     ; Next are the characters "HELL"
1012   517522,,514504     ; ..."ORLD"
1013   441415,,412407     ; ..."!", a carriage return, a line feed, and a bell
1014   000000,,000000     ; ...and more nulls than we need.

PDP-12

The story of this one is absolutely epic! The PDP-12 is an interesting combination of the LINC computer and the PDP-8 from 1969. The PDP-12 does have a front panel and a screen, but using that screen is no small feat. SpaceHobo over on the Discord did some pretty amazing work getting "Hellorld!" to run in an emulator, and once confident in the program, handed it off to Dr. Peterson to toggle into a real-deal running and working PDP-12! And here's where things get exciting.

When toggled in, it didn't actually work. SpaveHobo and Dr. Peterson debugged it as best they could, but there was the lingering doubt that maybe something in the real machine wasn't working right. It seems that the the AC never clears after returning from LINC mode: the AC always seems to have 0030 in it. That was weird indeed, and Vince who had been following along (who was the author of the emulator and also happens to have a real deal running and working PDP-12), decided to give the code a shot and got the same exact result! This sparked a ton of interesting conversation and deep-diving.

It turns out, it was a bug in the emulator!

To quote SpaceHobo:

"Incidentally, we found this because my friend sent me a video of him single-stepping through the code on the console in Duluth. I watched the blinkylights on my phone while having a pint down the pub here in London, and scribbled my diagnosis and (what I first thought was) a workaround on a copy of the listing. Vince tried it on his 12 in Oregon, and found that both machines behaved the same way. He had a fix in the emulator shortly after, and confirmed my "workaround" was actually a correct fix."

Y'all, do you know what this means? We're not just printing "Hellorld!" we're doing science stuff over here! This has got to be one of the coolest "Hellorld!" stories on the planet!

Full code with comments available here.

Code:

/ helrld.pa, by Nick Moffitt <[email protected]>

	LINC=6141	/ Instruction to switch to LINC mode
	PDP=0002	/ Instruction to switch back to PDP-8 mode

	HORIZ=1		/ LINC register 1, for horizontal position
	HALFCH=2	/ LINC register 2, points to each half of character

	*200		/ Standard starting page for instructions.
	
	JMP HLRLD	/ Initial vector to cleanup at end of block.
			/ AC should be clear at start,
			/ but the only side-effect is a single frame
			/ at the wrong y-value.  It's self-correcting.

DATA,	1077; 7710	/H
	4577; 4145	/E
	0177; 0301	/L
	0177; 0301	/L
	4177; 7741	/O
	4477; 3146	/R
	0177; 0301	/L
	4177; 3641	/D
	7500; 0000	/!

	DATA-1		/ Pointer to our text patterns
	0334 		/ Initial horizontal value
HLRLD,	TAD HLRLD-1	/ Load initial horizontal position
	DCA HORIZ	/ and put it in LINC register 1
	TAD HLRLD-2	/ Get our DATA pointer
	DCA HALFCH	/ Put it in the pattern register

PUTCH,  LINC
	1762		/ DSC I 2
	PDP
	CLA		/ DSC leaves 0030 in AC

	/ The DSC instruction pre-increments the bitmap "register"
	TAD I HALFCH	/ Take a look at the value we printed.
	SNA		/ If it's zero,
	JMP HLRLD	/ then we're done.  Refresh!
	CLA		/ Otherwise reset vertical to 0
	JMP PUTCH	/ And display it
$

SEL810A

Aint nothing like getting an oil and gas pipeline mini-computer from the 60s to print "Hellorld!" which is exactly what SomeComputerGuy did, and it's every bit as glorious as it sounds! Not only that, he got it to literally print using an ASR33 teletype as the terminal! The SEL810A is a beautiful "little" minicomputer that's actually built using discrete transistor cards that plug into wire-wrapped backplanes. The machine is surprisingly reliable for creeping up on 70 years old, and it's an absolute work of art inside!

Here's a video of this very SEL810A running Lunar Lander

Code: