Christmas Present (MEGA65/4510 Assembler) Author: Geir Straume Category: Christmas Challenge System: MEGA65 Language: Assembler (ACME) Len source code: 2472 bytes (source with comments) Len exe file: 42 bytes Len code only: 40 bytes (excl. load address) Instructions: Install the Xemu emulator (https://github.lgb.hu/xemu/) with MEGA65 ROM version 920413. 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: This version was created AFTER the challenge deadline. An 'asw abs' instruction is used to optimize the 'ColLoop' logic, and new line chars are now printed by calling a more specific ROM subroutine. 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. ROM version 920417 is also supported. Set ROM_VERSION to the appropriate value before assembly. See commented source code for further implementation details.