Christmas Present (MEGA65/4510 Assembler)
Author: Geir Straume
Category: Christmas Challenge
System: MEGA65
Language: Assembler (ACME)
Len source code: 2123 bytes (source with comments)
Len exe file: 46 bytes
Len code only: 44 bytes (excl. load address)
Instructions:
Install the Xemu emulator (https://github.lgb.hu/xemu/) with the latest stable MEGA65 ROM (v920395).
Drag and drop "present.prg" into the emulator window and select "C65" when prompted for which mode to run it in.
Enter SYS 11552 to start.
Description:
The code displays the top three ribbon chars by calling the ROM routine 'PrImm' (Print Immediate).
The main part of the present is displayed by writing 19 rows of 19 chars to the screen. Two zero page variables
and the carry flag are used to get 9-bit values which are rotated to determine every 9th row and column.
The program loads at $2d20 to be able to get two of the char numbers via known memory locations. Some bytes in ROM
are used to calculate two other char numbers. A memory location with a known value is used as a row counter.
See commented source code for further implementation details.