scene.org File Archive

File download

<root>­/­parties­/­2024­/­vccc24­/­christmas_challenge/spacewumpus_zxspectrum_assembly_vc3-2024.zip

File size:
47 228 bytes (46.12K)
File date:
2024-12-29 14:13:04
Download count:
all-time: 0

Preview

  • file_id.diz 1.63K
  • final.tap 107B
  • main.asm 4.52K
  • result.png 2.75K
  • source.png 44.77K

file_id.diz

VCCC24 Christmas Challenge

Author: spaceWumpus
Category: Christmas Challenge
System:   16/48k ZX Spectrum
Language: Assembler (sjasmplus)
Len source code: 82 bytes (BASIC stub incorporating the assembled code embedded in REM statement)
Len exe file:    103 bytes (standard header block (17 bytes), code block (76 bytes), plus flag byte and checksum byte for each (4 bytes))
Len code only:   58 bytes

Instructions:
Code is a standard TAP file, which should be loadable in any ZX Spectrum emulator.
Tested with Fuse emulator. 
1. Install and start Fuse.
2. Drag 'final.tap' file into the window.
3. Press 'R', then 'Enter' to run.

Description:
Assembled code is embedded into a REM (remark aka comment) in a BASIC program.  
Draws the entire pattern as five blocks of rows of 1/8/1/8/1 rows per block, alternating between
'+', '-', and '!', ' ' between each block.
Loop is partially unrolled so that each iteration prints e.g. '--------+'.
Loop is called 2.5 times to generate the full '+--------+--------+' pattern, by jumping in late on the first
iteration to skip the initial block of 8.  This is shorter than looping 5 times, but having to change the character
code on every iteration. ROM routine RST $10 is used to print characters.
Code relies on HL containing $2d2b on entry, which happens to be the char codes for '-' and '+', useful!
The bow on top required 15 bytes by itself, as it has nothing in common with the rest of the image.
The rest of the present takes 43 bytes.

Pretty happy with this again.  Slightly bigger code than last year, but shorter for the main pattern excluding the bow!

Total length of code 58 bytes.