Lovebyte 2022 ARM/Linux sizecoded Demos


Background

Lovebyte is a demoparty aimed directly at sizecoding! In addition to my usual Apple II submissions I also did a Raspberry Pi baremetal bootsector demo.

Source Code

The full source code for all of these entries is available on my armdemo github project.

The Entries

High-end 128B -- Thumbpinski



I'm teaching ARM THUMB2 assembly language this semester, so I thought I'd try some coding practice to refresh my ARM skills, otherwise I might accidentally end up teaching 6502 assembly to the students instead.

I wanted to see how small of a program I could write for Linux on a Raspberry Pi. It turns out that with the bare minimum ELF header is around 84 bytes, which doesn't leave much room.

In the end I used some techniques like in the
Tiny Elf Modernized document and put some of the code/data into the ELF header.

The code is just a boring sierpinski printed to standard-output with some ANSI escape characters for color. There's a syscall to nanosleep() to slow things down a bit. The executable is loaded at 0x8000 instead of 0x10000 so addresses would fit in the lower 16-bits.

Following the Lovebyte rules this could technically also be considered a 64 byte demo if you don't count the header.

The executable is statically linked, there's no calls to the C library.

You'll want to run this on a console that's at least 128 columns wide.

Finish: 9/9 128 Byte High-end Intro
Video: https://youtu.be/H-pSN9EKQe8
Download: thumbpinski_pouet.zip
Sourcecode: sierpinski_elfabuse.s
Pouet: https://www.pouet.net/prod.php?which=90925


High-end 256B -- Thumb2 Sierzoom



This is an implementation of Hellmood's Sierpinski Zoom code from the Memories demo, but in ARM Thumb2 assembly language for Raspberry Pi Linux (needs a Pi with Thumb2 support, so Pi2 or later)

This fits in 240 bytes and isn't playing ELF header games, as the algorithm ended up fitting well. It's statically linked, no calls to any libraries.

I did include a color-changing Desire logo. I had a few extra ideas to use up the free bytes but wasn't able to get anything useful in before the deadline.

The graphics are ANSI escape codes and text characters. I was originally trying for more colors rather than the text between the green, but thought in the end it gave it a nice almost greyscale look. The intro ran at acceptable speed over a network connection, but running on the native Linux framebuffer was too slow. To fix this a whole line of output is buffered before a WRITE() syscall, rather than writing things a pixel at a time.

You'll need to set your terminal to at least 128x50 for this to work. I should have made things slightly smaller as getting 128x50 to look reasonable at a resolution my HDMI capture card could handle was a bit tough. The capture was done on a Pi4 mostly because it was the most convenient model I had around when it was time to get a capture.

Finish: 7/7 256 Byte High-end Intro
Download:
sierzoom_pouet.zip
Video: https://youtu.be/4eQNolxV73Q
Sourcecode: sierzoom_asm.s
Pouet: https://www.pouet.net/prod.php?which=91035


See my Lovebyte 2022 entry for bare-metal Rapberry Pi

See my Lovebyte 2022 entries for the Apple II platform


Back to my Demos