scene.org File Archive

File download

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

File size:
133 125 bytes (130.00K)
File date:
2024-12-29 14:13:04
Download count:
all-time: 0

Preview

  • file_id.diz 1.32K
  • present.com 66B
  • result.png 75.71K
  • source.asm 583B
  • source.png 57.01K

file_id.diz

CHRISTMAS PRESENT

Author: Prevtenet
Category: Christmas Challenge
System:   CP/M-80 2.2
Language: Assembler (WinApe)
Len source code: 583
Len exe file:    66
Len code only:   66
Instructions:
Load the .COM file onto a machine or emulator running CP/M-80 2.2 and execute
from the command prompt by typing PRESENT. The official platform this is
claimed to run correctly on is the very quirky combination of CPvM running on
SymbOS 4 running on an Amstrad CPC (three layers of 8-bit! See symbos.org for
instructions on getting any or all of this set up.) It should also run on
most other CP/M machines, but the exact output may vary slightly depending on
the exact CP/M implementation and terminal emulation.

Description:
This is essentially a tiny decompression algorithm that takes advantage of how
the present shape can be considered a group of recursively repeating subunits.
It reads bytes from itself, with three cases:

     0 = return - return to the byte after the last call
  <128 = call   - continue reading from location 0x1xx 
  >128 = print  - print specified character (clearing bit 7)

Comments:
Bonus puzzle - can you work out why, on many CP/M 2.2 systems, this will exit
cleanly despite lacking an actual exit condition? Hint - the answer has to do
with how the CP/M 2.2 BIOS is laid out in memory.