Skip to content
Nakazoto edited this page Oct 29, 2023 · 27 revisions

Almost There!

This is a collection of entries that are close to meeting the guidelines, but not quite there. There is some epic code in here, and perhaps you can get it running on a unique machine to bring it up fully! Entries are in alphabetical order.

Quick links:

Intel 8088 Sega SG-1000

Intel 8088 (and compatibles)

The Microcomputer we all know and love - it simply needs no introduction, Intel's very own 8088. This code here is designed to be run as a (floppy) boot-sector, about as bare metal as reasonably possible. We start at 0x7C00 for our text segment, while poking the (color) VGA memory at 0xB800 directly. The padding until offset 0x1FD is truncated and is simply followed by the magic boot-sector byte 0x55AA.

Write this to your own floppy for some boot time shenanigans!

Code:

a1 2b 7c 8e c0 31 ff 31 c0 ab 81 ff d0 07 7e f9
be 21 7c bf c6 07 b4 0f ac ab 3c 00 75 fa eb fe
f4 48 45 4c 4c 4f 52 4c 44 21 00 00 b8 00 00 00

Sega SG-1000

The Sega SG-1000 is the predecessor the famous Master System and rocks the venerable Zilog Z80 with a TMS9918 VDP. Seatsafetyswitch over on the Discord got fired up about writing some assembly for it and came up with this masterpiece! The assembly could potentially run on a Master System or Genesis if, and I quote, "you're willing to get really weird with it." I'm 100% on-board if someone wants to get "weird" with it and get some Hellorld! on a Genesis!

Code:

It's actually too long to paste here in its entirety, but check out the full Assembly file by clicking here!

          org 0x7C00                     ; bootsector is copied to 7C00 by BIOS

          mov ax, [VGAMEM]               ; set the top of VGA memory
          mov es, ax                     ; copy into the segment register
          xor di, di                     ; we will be using ES:DI for writing
          
          xor ax, ax                     ; clear AX
CLS:      stosw                          ; copy AX to ES:DI, inc DI
          cmp di, 0x7D0                  
          jle CLS                        ; are we less than 80*25?

          mov si, MESSAGE                ; string start byte pointer
          mov di, 0x7C6                  ; start at row 12, col 71
          mov ah, 0xF                    ; set color 7, high intensity
PRINTS:   lodsb                          ; load byte from SS:SI into AL, inc SI
          stosw                          ; copy AX to ES:DI, inc DI

          cmp al, 0                      
          jne PRINTS                     ; have we printed the entire string?

DONE:     jmp DONE
          hlt                            ; end

MESSAGE:  db "HELLORLD!",0               ; message to display
VGAMEM:   dw 0xB800                      ; top of (color) VGA Textmode 

          times 0x1FE - ($ - $$) db 0    ; pad a maximum of 510 bytes          
          dw 0xAA55                      ; place magic bootsector token

          times 0xB3E00 - ($ - $$) db 0  ; pad to 720KB

8088