Jerry Penner's 2025 Quadrant Snowflake
Author: Jerry Penner
Category: Christmas Challenge
System: Apple II
Language: Assembler (Merlin assembler)
Len source code: 2564
Len exe file: 87
Len code only: 87
Instructions:
The disk-image in the ZIP file, jerry-2025-snowflake.po, can be booted directly from
slot 6. In the KEGS emulater, type F4, select Disk Configuration, select s6d1, select
the disk image, and start up the Apple II. If you have no other disks configured, this
snowflake disk will boot and display the snowflake image.
The code is located at memory location $300. To run it again, type this at the BASIC
prompt:
CALL 768
Description:
The code stores a bitmap of one quadrant of the snowflake.
For each line, it shifts the bits out, outputting space for a zero, and "*" for a one.
It also pushes each character so generated onto the stack. When it gets to the last "1
bit" in the bit stream for a line, it pops characters off the stack and outputs them
until the stack is empty (a sentinel byte is pushed at the start of each line).
Finally, it outputs a carriage return.
It does this for each of the first ten lines, and then it walks backwards through the
bitmap, outputting lines 9 down through 1 just as above. When it is done, it returns to
the system prompt.
Comments:
I developed this on Linux, using a Merlin assembler clone I wrote myself. Merlin
assembler on the Apple II or the Merlin32 assembler written by Brutal Deluxe Software
(https://brutaldeluxe.fr/products/crossdevtools/merlin/) ought to work too.
I also have my own disk-image tools that I use to create the Apple II disk-image for
testing on the KeGS emulator (https://kegs.sourceforge.net/). Something like Cider
Press II (https://ciderpress2.com/) or Apple Commander
(https://applecommander.github.io/) ought to do the job too. The PRODOS and
BASIC.SYSTEM files are on the disk-image so the disk boots and runs the code file named
STARTUP.
Included in the ZIP file is a Makefile that uses the above two tools to assemble and
package the code.
The source is in the ZIP file, as well as in the disk-image.