CP/M Chirstmas Star

Author: Sergey Kiselev <[email protected]>
Category: Christmas Challenge
System:   CP/M, Intel 8080, Zilog Z80, Zeta SBC, RC2014, etc.
Language: CP/M 8080 Assembler, CP/M-80 v2.2
Len source code: 1926
Len exe file:    128 bytes (78 bytes, rounded up to 128 bytes - CP/M sector size)
Len code only:   78 bytes

Instructions:
Use Intel 8080 CPU Emulator by Stefan Tramm: https://www.tramm.li/i8080/emu8080.html
1. Load CP/M by typing the following commands:
r 0 cpma
b
g 0
2. Drag and drop the source code, star.asm into the emulator's terminal, it will be mounted as a 'tape'
3. Type 'pip starp.asm=rdr:' command to copy the content of the tape to the starp.asm file
4. Use the following commands to build the executable:
asm starp
load starp
5. Finally, type 'starp' to start this program
Alternatively, instead using the emulator, the source code can be uploaded to a real CP/M system,
such as Zeta SBC or RC2014 using XMODEM 'xm r starp.asm' command.
The build and run steps are the same as in the emulator's instructions above.

Description:
The algorithm uses the symmetry of the star, with the origin (0,0) being in the center of the star. It iterates over -8 <= X <= 8 and -8 <= Y <= 8
- For the positive quarter, it draws asterisks everywhere except of the following cases:
 - The corner, where both X>4 and Y>4
 - Two 45° cutouts. These cutouts can be described by the following inequalities: X-Y>4 and Y-X>4
The other three quarters are a mirror image of the positive quarter, and are checked using using absolute value of coordinates "ABS()"

For a more optimal implementation in 8080 assembly, the actual loops go from 17 to 0, with column and row counters stored in L and H registers respectively.
The ABS(X) and ABS(Y) when calculated inside the loop.

Note that the star size is parameterized (SIZE), so the algorithm can be easily modified to draw larger or smaller stars

Comments:
The code can be easily modified to run on any other 8080 or Z80 system, by replacing the PUTC routine
with the corresponding terminal/screen output routine on the target system