Skip to content
Nakazoto edited this page Nov 18, 2023 · 24 revisions

Hellorld! on Microcomputers

This is a page dedicated to seeing "Hellorld!" run on Microcomputers. The classification of microcomputer can sometimes get a little blurry, but we'll try to stick with what is traditionally considered a micro here. Listings are in alphabetical order.

Quick links:

Atari 2600 DEC Rainbow NABU NDR Klein with SC/MP
Northstar Advantage SAGE-II 68000 SWTPC 6800 TI-99/4
Wangwriter

Atari 2600

At first blush, this one seems ill-suited to this compendium of "Hellorld!" The Atari 2600 was a very common 8-bit video games console that debuted in 1977. As a matter of fact, the first video game I ever played was Frogger on an Atari. And I actually scrolled right by Dadecoza's submission, thinking it wasn't rare enough. Then it hit me - the Atari isn't a computer. It doesn't have a keyboard, but this submission is raw assembly dumped in through a hexadecimal memory monitor! Now we're talking!

Dadecoza not only ported Wozmon to the Atari 2600, they built a custom hexadecimal number pad for keying in values, transforming the 2600 from a mere games console to a proper computer. Now, that's exactly my kind of madness!

Code:

      1  f017                           PROCESSOR 6502
      2  f017    00 a5       MsgPtr     EQU $a5        ; Address containing address of message data
      3  f017    fc d6       PrintMsg   EQU $fcd6      ; Monitor subroutine for displaying text
      4  f017    fd c0       Done       EQU $fdc0      ; Address for returning control to monitor
      5  f000                           ORG $F000      ; Our code starts at F000
      6  f000    a9 0e                  LDA #<Message  ; Get high byte of message address
      7  f002    85 a5                  STA MsgPtr     ; Store it in MsgPtr
      8  f004    a9 f0                  LDA #>Message  ; Get low byte of message address
      9  f006    85 a6                  STA MsgPtr+1   ; Store it in MsgPtr+1
     10  f008    20 d6 fc               JSR PrintMsg   ; Call subroutine to display the message
     11  f00b    4c c0 fd               JMP Done       ; Return control to the monitor
     12  f00e    04          Message    .byte.b #$04   ; New Line
     13  f00f    19                     .byte.b #$19   ; 'H'
     14  f010    16                     .byte.b #$16   ; 'E'
     15  f011    1d                     .byte.b #$1d   ; 'L'
     16  f012    1d                     .byte.b #$1d   ; 'L'
     17  f013    20                     .byte.b #$20   ; 'O'
     18  f014    23                     .byte.b #$23   ; 'R'
     19  f015    1d                     .byte.b #$1d   ; 'L'
     20  f016    15                     .byte.b #$15   ; 'D'
     21  f017    00                     .byte.b #$00   ; String terminator
     22  f017                           END

DEC Rainbow

I don’t think DEC would be too happy with us calling the Rainbow a rare machine as they made an absolute ton of them. But, as a fellow Rainbow owner, I couldn’t help but love to see Mechafinch get “Hellrold!” running on their Rainbow. So, I think we can squeeze the Rainbow into this list simply because it makes me smile! This particular code was written in the DOS debug prompt.

Code:

0100      mov dx, 0200
0103      mov ah, 09
0105      int 21
0107      mov ah, 4c
0109      int 21

0200      db "Hellorld!",0d,0a,"$"

NABU

Initially, I thought getting "Hellorld!" to run on a NABU would be fairly trivial, but turns out, it's far more intense than I was expecting! I'll let Atkelar explain:

"The code runs as boot code, pretty much as a stripped down version of the "Hardware-Testcode/FirstSteps" in my modem project. The modem PCB you can see in the picture between the Nabu and keybaord is homebrew, because it doesn't have any storage device on its own. It was supposed to boot via a cable TV modem and provide a sort of "Teletext" (that's what we call it around here) with a bit enhanced features. It only contains a small 4k boot ROM that has enough smarts for a bit of hardware checking and requesting an actual program from the modem. My code inside the modem mimics the required responses to transfer the Z80 assembly compiled code into the RAM, where it gets executed from the boot ROM. Since the video display is based on a TMS9918A chip, there is no built in character set. The ROM comes with "upper case only" letters; the lower case ones form the NABU logo on the splash screen. I am calling the "print" routine that the boot ROM provides to print out the "HELLORLD!" message."

Code:

org 0140Dh      ; OS Entry point is 0140Fh, but binary is loaded to 0140Dh...

defw 0          ; ...so we need filler bytes for alignement

program_entry_point:        ; the boot ROM jumps here after loading the code.

    ld hl, hellorld_msg_1
    call 056bh              ; "print" method in boot rom;

    halt                    ; Interrupts are disabled, so halt should stop perpetually.
    jr program_entry_point  ; loop, just in case, but halt should stop us.


;   NABU ROM "print" method expects the number of characters, screen RAM offset (2-bytes)
;   followed by the text. The character set is set up by the ROM initially;

hellorld_msg_1:
defb 9              ;   the number of characters to print
defw 02f8h          ;   the screen RAM offset (40*line+column)
defb "HELLORLD!"    ;   our text message.

NDR Klein with SC/MP

This is a really interesting one! The NDR Klein Computer is a German do-it-yourself micrcomputer kit. I believe it would have come with a Zilog ZS80 or Motorola 68020, which would have been very cool indeed. However, Mhaardt took it one step further and decided to use a new HEXIO card packing the very interesting National Semiconductor SC/MP - Simple Cost-effective Micro Processor. If that seems a little hard to follow, fret not, Mhaardt has a full write up on the system and the new card at the link below!

Click me for more information on the SC/MP card for the NDR Klein.

To quote Mhaardt directly:

"The SC/MP is an early microprocessor featured in an Elektor series from the end of the 70s. The NDR Klein Computer is a modular DIY system from the early 80s, comparable to S100, ECB and RC2014 systems, featured in a German educational TV series and in the magazine mc microcoputer. What you see is a new edition of the HEXIO and CPU card of the Elektor system adapted to the NDR Klein Computer bus. If you load the hex code using the monitor program and run it: Hellorld

The odd looking string are the bits set in the 7 segment display, loaded directly at address 0x700-0x707 (from right to left)."

But can it Hellorld? You bet it can! The seven segment display is put to good use here, display Hellorld in all it's glory!

Code:

       1/       0 :                     l function n,n&0xff
       2/       0 :                     h function n,n>>8
       3/       0 :                     
       4/     C00 :                       org 0xc00
       5/     C00 : C4 08                 ldi l(0x708)
       6/     C02 : 31                    xpal p1
       7/     C03 : C4 07                 ldi h(0x708)
       8/     C05 : 35                    xpah p1
       9/     C06 : C4 16                 ldi l(msg)
      10/     C08 : 32                    xpal p2
      11/     C09 : C4 0C                 ldi h(msg)
      12/     C0B : 36                    xpah p2
      13/     C0C :                     loop:
      14/     C0C : C6 01                 ld @1(p2)
      15/     C0E : 98 04                 jz done
      16/     C10 : CD FF                 st @-1(p1)
      17/     C12 : 90 F8                 jmp loop
      18/     C14 :                     done:
      19/     C14 : 90 FE                 jmp done
      20/     C16 :                     
      21/     C16 :                     msg:
      22/     C16 : 76                    db 2|4|16|32|64       ; H
      23/     C17 : 79                    db 1|8|16|32|64       ; E
      24/     C18 : 38                    db 8|16|32            ; L
      25/     C19 : 38                    db 8|16|32            ; L
      26/     C1A : 3F                    db 1|2|4|8|16|32      ; O
      27/     C1B : 50                    db 16|64              ; r
      28/     C1C : 38                    db 8|16|32            ; L
      29/     C1D : 5E                    db 2|4|8|16|64        ; d
      30/     C1E : 00                    db 0

Northstar Advantage

The Northstar Advantage was released in 1982 and came packing with the NorthStar 5-1/4 floppy disk sub-system, a high-resolution display, a Z80 with optional 8088 co-processor card, 64k of RAM (expandable up to 256k). Much like the DEC Rainbow, this was a true tri-boot system that could boot CP/M, NS-GDOS, or MS-DOS. Unfortunately, also like the Rainbow, the 8088 co-processor card wasn’t compatible with other PC-DOS versions, and not very much software was developed for the system. However, where we’re going, we don’t need no stinking software, we have assembly!

Sage wrote a bare-metal version of “Hellorld!” that runs on the Z80 processor along with an NS-GDOS version that runs on the Z80 processor.

Check this link for Sage’s Github on the project.

Code:

COUT      EQU       0F80DH
RESTART   EQU       0F828H

          ORG       00000H
          LXI       D,MSG
          CALL      PRINT
          CALL      RESTART
          HLT
PRINT:
          LDAX      D
          CPI       0
          RZ
          MOV       B,A
          MVI       A,0
          CALL      COUT
          INX       D
          JMP       PRINT
MSG:
          'HELLORLD!',0DH,0AH,0

SAGE II 68000 (later known as Stride)

This is a Motorola 68000 microcomputer from 1982 that my friend Dick Lord recently gave me (ecwhitney42) to explore for the nostalgia of 80's computing. It has BASIC, Pascal, Fortran 77, and Modula-2, all of which I learned to program before I finished college. The first computer I owned was a Z80-based CP/M machine so as much as that operating system is still bizarre to me, at least it's familiar. This video seemed like a really good excuse to break out those rusty machine language programming skills and have some fun. We booted the 40 year old CP/M 68K disks with NO errors and the machine runs like a champ. I have since found a box of sealed, unopened floppy disks on Amazon (of course) and started making backups. I have also found backups on the internet but I currently have no way of making physical disks because I don't have any other machines with a 5-1/2" floppy drive.

SAGE-II

I did two versions of the code, the first uses a BIOS call to print to the terminal and the second uses the CP/M BDOS function to do the same thing. I just wanted to understand how do that in assembly.

AS68 BIOS version

* Hellorld
* by Erich Whitney
* October 2023
* Sage II
* CP/M AS68 BIOS Version
                .text
                .globl  _init
_init:  lea     txtstr,a0
loop:   move.b  (a0)+,d0
        beq     lend
        trap    #10
        bra     loop
        lend:   rts
txtstr: .dc.b   "Hellorld!",13,10,0
        .end

Code:

41F8 000E 1018 6704 4E4A 60F8 4E75
4865 6C6C 6F72 6C64 210D 0A00

AS68 BDOS Version

* Hellorld
* by Erich Whitney
* October 2023
* Sage II
* CP/M 68K BDOS Version
                .text
                .globl  _init
_init:  lea     txtstr,a0
loop:   move.b  (a0)+,d1
        beq     lend
        move.w  #$2,d0
        trap    #2
        bra     loop
        lend:   rts
        .data
txtstr: .dc.b   "Hellorld!",13,10,0
        .end

Code: (note in this version the second word of the code has to be edited to point to the data segment wherever it gets stored in memory)

.text
41F8 0000 1218 6708 303C 0002 4E42 60F4 4E75  
.data
4865 6C6C 6F72 6C64 210D 0A00

Hellorld-Screenshot

SWTPC 6800

The SWTPC is a brilliant little machine built by a company out of San Antonio (being a Texan, I may be a bit biased), but my good buddy David is slowly bringing one of his SWTPCs back to life, and of course, the best way to test a machine out is by punching in "Hellorld!" The code from 0x0000 to 0x000D is the ASCII representation of "Hellorld!" and from 0x000E to 0x0016 is the actual program, which just runs a ROM subroutine to print characters to the terminal until it sees "04."

Code:

$M 0000 0D 0A 48 45 4C 4C 4F 53 4C 44 21 0D 0A 04 CE 00 00 BD E0 7E BD E0 E3
$J 000E

TI-99/4

This one is in clear violation of the rule expressing a desire for a unique machine, but here me out. The original TI-99/4 is actually quite a rare machine, with only around 20,000 ever made before they were upgraded to the TI-99/4A. The TMS-9900 16-bit processor is also a gem of a CPU as it's a full-fledged minicomputer CPU stuffed inside a very compromised microcomputer design.

I actually have a full series on bringing this machine up at this link here!

Code:

7D00 02E0 70B8      LWPI >70B8          ; Load memory area for registers
7D04 04C0           CLR R0              ; Load zero in register 0
7D06 0201 2000      LI Rl,>2000         ; Load ASCII space [>20] in left byte Rl
7D0A 0420 6024 LP   BLWP @>6024         ; Print the blank
7D0E 0580           INC R0              ; Increase the screen printing position
7D10 0280 0300      CI R0,768           ; Compare to first place beyond screen
7D14 11FA           JLT LP              ; Jump to LP if less than
7D18 0200 012A      LI R0,298           ; Load screen printing position
7D1C 0201 7D28      LI R1,TX            ; Load position of text in memory
7D1E 0202 0009      LI R2,9             ; Length of text: nine bytes
7D22 0420 6028      BLWP @>6028         ; Print text on screen
7D26 10FE           JMP$                ; Create endless loop 
7D28           TX   TEXT 'HELLORLD!'    ; Text to be displayed
7D28 48 45 4C 4C 4F 52 4C 44 21

Wangwriter

The Wangwriter is a really interesting system because it's actually a full-fledged Z80 based computer with 96k of RAM masquerading as a word processor. However, without the system disk, the machine is essentially OS-less, making it just a very pretty paperweight. That is, unless you get crafty and take an archive disk, which has a "Not a System Disk" routine at the beginning of it, rewrite some bits and get it to print "Hellorld!" The code to get this done is actually quite intense, and we still have a lot to learn about the system, but it's going to be a properly fun project to dive into!

Check out more on the Wangwriter here.

Code:

C3 31 02 48 45 4C 4C 4F 52 4C 44 21 00
02 31 00 02 CD 56 02 01 03 02 C5 11 00 F6 01 11 00 CD 7D 02 01 14 02 C5 11 00 F7 01 1A 00 CD 7D 
02 C3 51 02 FB 76 3E 80 D3 03 D3 4E D3 4A D3 4E 3E 63 D3 40 3E 26 D3 41 3E 55 D3 42 3E D7 D3 43 
3E 14 D3 44 3E 1F D3 45 3E 17 D3 46 C9 E1 E3 78 B1 28 02 ED B0 C9