scene.org File Archive

File download

<root>­/­parties­/­2023­/­vccc23­/­christmas-diamonds/bexxx_c64_asm_vc3-2023.zip

File size:
249 696 bytes (243.84K)
File date:
2024-01-03 14:15:17
Download count:
all-time: 1

Preview

  • file_id.diz 1.33K
  • result-colored.png 2.53K
  • result-colored.prg 80B
  • result.png 2.44K
  • result.prg 75B
  • source-readable.asm 1.20K
  • source-short.asm 409B
  • source.png 311.75K

file_id.diz

VC3 - This time before deadline

Author: Ralf "bexxx" Beckers / MoonShine
Category: Christmas Challenge
System: C64
Language: Assembler (kickassembler)
Len source code: 433
Len exe file: 72
Len code only: 59
Instructions:
Just run on machine or drag and drop into vice
Description:
1. Algorithm prints 3 rectangles, some chars are overwritten, which is fine. Rectangles end on the outer edges of the shape
2. Using x and y offset == 0 to use bpl / bne branches instead of cmp & branch
3. Using $39 in zero page to calc the x start of the squares, first initialization by low byte of basic line number. lda,sta with zp also have shorter opcodes. Noice! (Thanks Serato/FIG for documenting this in the xmas challenge from 2021!)
4. rts at the end would overwrite shape with READY, jmp to same address would be 3 bytes, doing a beq instead to save 1 byte
5. Not initializing x register (for y). It's 0 on start, which is perfect (see xy offsets). Updated the algorithm to not decrement to -1 on the last side of the rectangle but stop on 0 to reuse that value in the next iteration.
Comments:
Full source available here after deadline: https://github.com/bexxx/commodore64/tree/main/competitions/2023-VC3
The files with -colored show that the code works by using colored * for printing. This code is 5 bytes longer because of the lda and jsr to setup the colors.