<?xml version="1.0"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en">
		<id>http://www.sizecoding.org/api.php?action=feedcontributions&amp;feedformat=atom&amp;user=Logiker</id>
		<title>SizeCoding - User contributions [en]</title>
		<link rel="self" type="application/atom+xml" href="http://www.sizecoding.org/api.php?action=feedcontributions&amp;feedformat=atom&amp;user=Logiker"/>
		<link rel="alternate" type="text/html" href="http://www.sizecoding.org/wiki/Special:Contributions/Logiker"/>
		<updated>2026-05-01T09:48:03Z</updated>
		<subtitle>User contributions</subtitle>
		<generator>MediaWiki 1.27.0</generator>

	<entry>
		<id>http://www.sizecoding.org/index.php?title=Christmas_Star&amp;diff=1205</id>
		<title>Christmas Star</title>
		<link rel="alternate" type="text/html" href="http://www.sizecoding.org/index.php?title=Christmas_Star&amp;diff=1205"/>
				<updated>2022-12-28T20:41:48Z</updated>
		
		<summary type="html">&lt;p&gt;Logiker: Christmas Star from the Vintage Computing Christmas Challenger 2022&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;[[Category:Case Study]]&lt;br /&gt;
==The challenge==&lt;br /&gt;
During the [https://demozoo.org/parties/4578/ Vintage Computing Christmas Challenge 2022] the goal was to create the shape of a given Christmas star with as few bytes as possible. All platforms and languages were allowed.&lt;br /&gt;
The star should look exactly like shown below.&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
               *       *&lt;br /&gt;
               **     **&lt;br /&gt;
               ***   ***&lt;br /&gt;
               **** ****&lt;br /&gt;
           *****************&lt;br /&gt;
            ***************&lt;br /&gt;
             *************&lt;br /&gt;
              ***********&lt;br /&gt;
               *********&lt;br /&gt;
              ***********&lt;br /&gt;
             *************&lt;br /&gt;
            ***************&lt;br /&gt;
           *****************&lt;br /&gt;
               **** ****&lt;br /&gt;
               ***   ***&lt;br /&gt;
               **     **&lt;br /&gt;
               *       *&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
There were mainly two kinds of approaches:&lt;br /&gt;
* draw character by character&lt;br /&gt;
* mirror triangles&lt;br /&gt;
* etc&lt;br /&gt;
==Winning Entries==&lt;/div&gt;</summary>
		<author><name>Logiker</name></author>	</entry>

	<entry>
		<id>http://www.sizecoding.org/index.php?title=File_format&amp;diff=1002</id>
		<title>File format</title>
		<link rel="alternate" type="text/html" href="http://www.sizecoding.org/index.php?title=File_format&amp;diff=1002"/>
				<updated>2022-01-17T09:23:25Z</updated>
		
		<summary type="html">&lt;p&gt;Logiker: Sorted descencding by bit, added Amiga template&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;=File formats=&lt;br /&gt;
&lt;br /&gt;
File formats describe the content of a file. &lt;br /&gt;
&lt;br /&gt;
This page is not about:&lt;br /&gt;
* File systems which organize files on a partition&lt;br /&gt;
* Disk images which save a (disk) file system within one file&lt;br /&gt;
* Tape file formats, as they have a higher overhead usually&lt;br /&gt;
&lt;br /&gt;
==IBM PC==&lt;br /&gt;
&lt;br /&gt;
===COM===&lt;br /&gt;
System: MS-DOS&lt;br /&gt;
&lt;br /&gt;
Header: 0 bytes see [https://en.wikipedia.org/wiki/COM_file here]&lt;br /&gt;
&lt;br /&gt;
Native size unit: Bytes&lt;br /&gt;
&lt;br /&gt;
Loads to: 0100h&lt;br /&gt;
&lt;br /&gt;
Starts at: &lt;br /&gt;
&lt;br /&gt;
File extension: .com&lt;br /&gt;
&lt;br /&gt;
===EXE===&lt;br /&gt;
System: Windows&lt;br /&gt;
&lt;br /&gt;
Header: 200+&lt;br /&gt;
&lt;br /&gt;
Native size unit: Bytes&lt;br /&gt;
&lt;br /&gt;
Loads to: &lt;br /&gt;
&lt;br /&gt;
Starts at: &lt;br /&gt;
&lt;br /&gt;
File extension: .exe&lt;br /&gt;
&lt;br /&gt;
===Linux===&lt;br /&gt;
System: Linux&lt;br /&gt;
&lt;br /&gt;
Header: ca. 100&lt;br /&gt;
&lt;br /&gt;
Native size unit: Bytes&lt;br /&gt;
&lt;br /&gt;
Loads to: &lt;br /&gt;
&lt;br /&gt;
Starts at: &lt;br /&gt;
&lt;br /&gt;
File extension: none&lt;br /&gt;
&lt;br /&gt;
==Atari ST==&lt;br /&gt;
===TOS===&lt;br /&gt;
System: Atari ST&lt;br /&gt;
&lt;br /&gt;
Header: 32 Bytes &lt;br /&gt;
&lt;br /&gt;
Native size unit: ???&lt;br /&gt;
&lt;br /&gt;
Loads to: &lt;br /&gt;
&lt;br /&gt;
Starts at:  &lt;br /&gt;
&lt;br /&gt;
File extension:  &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==Amiga==&lt;br /&gt;
===...===&lt;br /&gt;
System: Amiga&lt;br /&gt;
&lt;br /&gt;
Header: &lt;br /&gt;
&lt;br /&gt;
Native size unit: ???&lt;br /&gt;
&lt;br /&gt;
Loads to: &lt;br /&gt;
&lt;br /&gt;
Starts at:  &lt;br /&gt;
&lt;br /&gt;
File extension:  &lt;br /&gt;
&lt;br /&gt;
==Commodore 64==&lt;br /&gt;
===PRG===&lt;br /&gt;
System: CBM-DOS (Commodore, e.g. C64)&lt;br /&gt;
&lt;br /&gt;
Header: 2 bytes (= start address)&lt;br /&gt;
&lt;br /&gt;
Native size unit: Blocks (256 bytes including 2 bytes linking to next block)&lt;br /&gt;
&lt;br /&gt;
Loads to: given address in header&lt;br /&gt;
&lt;br /&gt;
Starts at: given address in header&lt;br /&gt;
&lt;br /&gt;
File extension: .prg&lt;br /&gt;
&lt;br /&gt;
===P00===&lt;br /&gt;
System: CBM-DOS / PC64 Emulator&lt;br /&gt;
&lt;br /&gt;
Header: extended 26 bytes; also includes the name; see [http://unusedino.de/ec64/technical/formats/pc64.html here]&lt;br /&gt;
&lt;br /&gt;
Native size unit: Blocks&lt;br /&gt;
&lt;br /&gt;
Loads to: given address in header&lt;br /&gt;
&lt;br /&gt;
Starts at: given address in header&lt;br /&gt;
&lt;br /&gt;
File extension: .p00&lt;br /&gt;
&lt;br /&gt;
==Atari 8bit==&lt;br /&gt;
===XEX, EXE, COM===&lt;br /&gt;
System: Atari&lt;br /&gt;
&lt;br /&gt;
Header: 6 bytes or more (FF FF &amp;lt;start address&amp;gt; &amp;lt;end address&amp;gt;); see also [https://www.atarimax.com/jindroush.atari.org/afmtexe.html here]&lt;br /&gt;
&lt;br /&gt;
Native size unit: ???&lt;br /&gt;
&lt;br /&gt;
Loads to: given start address in header&lt;br /&gt;
&lt;br /&gt;
Starts at: given end address in header&lt;br /&gt;
&lt;br /&gt;
File extension: .exe .com .xex (any ending possible)&lt;br /&gt;
&lt;br /&gt;
==Amstrad==&lt;br /&gt;
===BIN===&lt;br /&gt;
System: AMSDOS (Amstrad CPC)&lt;br /&gt;
&lt;br /&gt;
Header: 128 bytes (includes filename, start address, end address, etc.; 95 unused bytes; see also [https://www.cpcwiki.eu/index.php/AMSDOS_Header AMSDOS-Header]&lt;br /&gt;
&lt;br /&gt;
Native size unit: kb &lt;br /&gt;
&lt;br /&gt;
Loads to: given start address in header&lt;br /&gt;
&lt;br /&gt;
Starts at: given end address in header&lt;br /&gt;
&lt;br /&gt;
File extension: .bin (on PC)&lt;br /&gt;
&lt;br /&gt;
==Spectrum==&lt;br /&gt;
===Binary===&lt;br /&gt;
System: ZX Spectrum&lt;br /&gt;
&lt;br /&gt;
Header: none&lt;br /&gt;
&lt;br /&gt;
Native size unit: ???&lt;br /&gt;
&lt;br /&gt;
Loads to: special loader required; usually a BASIC program&lt;br /&gt;
&lt;br /&gt;
Starts at: see above&lt;br /&gt;
&lt;br /&gt;
File extension: ??? usually delivered within a disk image (.trd)&lt;/div&gt;</summary>
		<author><name>Logiker</name></author>	</entry>

	<entry>
		<id>http://www.sizecoding.org/index.php?title=File_format&amp;diff=1001</id>
		<title>File format</title>
		<link rel="alternate" type="text/html" href="http://www.sizecoding.org/index.php?title=File_format&amp;diff=1001"/>
				<updated>2022-01-17T09:16:18Z</updated>
		
		<summary type="html">&lt;p&gt;Logiker: added Linux&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;=File formats=&lt;br /&gt;
&lt;br /&gt;
File formats describe the content of a file. &lt;br /&gt;
&lt;br /&gt;
This page is not about:&lt;br /&gt;
* File systems which organize files on a partition&lt;br /&gt;
* Disk images which save a (disk) file system within one file&lt;br /&gt;
* Tape file formats, as they have a higher overhead usually&lt;br /&gt;
&lt;br /&gt;
==IBM PC==&lt;br /&gt;
&lt;br /&gt;
===COM===&lt;br /&gt;
System: MS-DOS&lt;br /&gt;
&lt;br /&gt;
Header: 0 bytes see [https://en.wikipedia.org/wiki/COM_file here]&lt;br /&gt;
&lt;br /&gt;
Native size unit: Bytes&lt;br /&gt;
&lt;br /&gt;
Loads to: 0100h&lt;br /&gt;
&lt;br /&gt;
Starts at: &lt;br /&gt;
&lt;br /&gt;
File extension: .com&lt;br /&gt;
&lt;br /&gt;
===EXE===&lt;br /&gt;
System: Windows&lt;br /&gt;
&lt;br /&gt;
Header: 200+&lt;br /&gt;
&lt;br /&gt;
Native size unit: Bytes&lt;br /&gt;
&lt;br /&gt;
Loads to: &lt;br /&gt;
&lt;br /&gt;
Starts at: &lt;br /&gt;
&lt;br /&gt;
File extension: .exe&lt;br /&gt;
&lt;br /&gt;
===Linux===&lt;br /&gt;
System: Linux&lt;br /&gt;
&lt;br /&gt;
Header: ca. 100&lt;br /&gt;
&lt;br /&gt;
Native size unit: Bytes&lt;br /&gt;
&lt;br /&gt;
Loads to: &lt;br /&gt;
&lt;br /&gt;
Starts at: &lt;br /&gt;
&lt;br /&gt;
File extension: none&lt;br /&gt;
&lt;br /&gt;
==Commodore==&lt;br /&gt;
===PRG===&lt;br /&gt;
System: CBM-DOS (Commodore, e.g. C64)&lt;br /&gt;
&lt;br /&gt;
Header: 2 bytes (= start address)&lt;br /&gt;
&lt;br /&gt;
Native size unit: Blocks (256 bytes including 2 bytes linking to next block)&lt;br /&gt;
&lt;br /&gt;
Loads to: given address in header&lt;br /&gt;
&lt;br /&gt;
Starts at: given address in header&lt;br /&gt;
&lt;br /&gt;
File extension: .prg&lt;br /&gt;
&lt;br /&gt;
===P00===&lt;br /&gt;
System: CBM-DOS / PC64 Emulator&lt;br /&gt;
&lt;br /&gt;
Header: extended 26 bytes; also includes the name; see [http://unusedino.de/ec64/technical/formats/pc64.html here]&lt;br /&gt;
&lt;br /&gt;
Native size unit: Blocks&lt;br /&gt;
&lt;br /&gt;
Loads to: given address in header&lt;br /&gt;
&lt;br /&gt;
Starts at: given address in header&lt;br /&gt;
&lt;br /&gt;
File extension: .p00&lt;br /&gt;
&lt;br /&gt;
==Atari 8bit==&lt;br /&gt;
===XEX, EXE, COM===&lt;br /&gt;
System: Atari&lt;br /&gt;
&lt;br /&gt;
Header: 6 bytes or more (FF FF &amp;lt;start address&amp;gt; &amp;lt;end address&amp;gt;); see also [https://www.atarimax.com/jindroush.atari.org/afmtexe.html here]&lt;br /&gt;
&lt;br /&gt;
Native size unit: ???&lt;br /&gt;
&lt;br /&gt;
Loads to: given start address in header&lt;br /&gt;
&lt;br /&gt;
Starts at: given end address in header&lt;br /&gt;
&lt;br /&gt;
File extension: .exe .com .xex (any ending possible)&lt;br /&gt;
&lt;br /&gt;
==Atari ST==&lt;br /&gt;
===TOS===&lt;br /&gt;
System: Atari ST&lt;br /&gt;
&lt;br /&gt;
Header: 32 Bytes &lt;br /&gt;
&lt;br /&gt;
Native size unit: ???&lt;br /&gt;
&lt;br /&gt;
Loads to: &lt;br /&gt;
&lt;br /&gt;
Starts at:  &lt;br /&gt;
&lt;br /&gt;
File extension:  &lt;br /&gt;
&lt;br /&gt;
==Amstrad==&lt;br /&gt;
===BIN===&lt;br /&gt;
System: AMSDOS (Amstrad CPC)&lt;br /&gt;
&lt;br /&gt;
Header: 128 bytes (includes filename, start address, end address, etc.; 95 unused bytes; see also [https://www.cpcwiki.eu/index.php/AMSDOS_Header AMSDOS-Header]&lt;br /&gt;
&lt;br /&gt;
Native size unit: kb &lt;br /&gt;
&lt;br /&gt;
Loads to: given start address in header&lt;br /&gt;
&lt;br /&gt;
Starts at: given end address in header&lt;br /&gt;
&lt;br /&gt;
File extension: .bin (on PC)&lt;br /&gt;
&lt;br /&gt;
==Spectrum==&lt;br /&gt;
===Binary===&lt;br /&gt;
System: ZX Spectrum&lt;br /&gt;
&lt;br /&gt;
Header: none&lt;br /&gt;
&lt;br /&gt;
Native size unit: ???&lt;br /&gt;
&lt;br /&gt;
Loads to: special loader required; usually a BASIC program&lt;br /&gt;
&lt;br /&gt;
Starts at: see above&lt;br /&gt;
&lt;br /&gt;
File extension: ??? usually delivered within a disk image (.trd)&lt;/div&gt;</summary>
		<author><name>Logiker</name></author>	</entry>

	<entry>
		<id>http://www.sizecoding.org/index.php?title=File_format&amp;diff=1000</id>
		<title>File format</title>
		<link rel="alternate" type="text/html" href="http://www.sizecoding.org/index.php?title=File_format&amp;diff=1000"/>
				<updated>2022-01-17T09:11:14Z</updated>
		
		<summary type="html">&lt;p&gt;Logiker: Added Windows and Atari ST format (template)&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;=File formats=&lt;br /&gt;
&lt;br /&gt;
File formats describe the content of a file. &lt;br /&gt;
&lt;br /&gt;
This page is not about:&lt;br /&gt;
* File systems which organize files on a partition&lt;br /&gt;
* Disk images which save a (disk) file system within one file&lt;br /&gt;
* Tape file formats, as they have a higher overhead usually&lt;br /&gt;
&lt;br /&gt;
==MS-DOS==&lt;br /&gt;
===COM===&lt;br /&gt;
System: MS-DOS&lt;br /&gt;
&lt;br /&gt;
Header: 0 bytes see [https://en.wikipedia.org/wiki/COM_file here]&lt;br /&gt;
&lt;br /&gt;
Native size unit: Bytes&lt;br /&gt;
&lt;br /&gt;
Loads to: 0100h&lt;br /&gt;
&lt;br /&gt;
Starts at: &lt;br /&gt;
&lt;br /&gt;
File extension: .com&lt;br /&gt;
&lt;br /&gt;
==Windows==&lt;br /&gt;
===EXE===&lt;br /&gt;
System: Windows&lt;br /&gt;
&lt;br /&gt;
Header: 200+&lt;br /&gt;
&lt;br /&gt;
Native size unit: Bytes&lt;br /&gt;
&lt;br /&gt;
Loads to: &lt;br /&gt;
&lt;br /&gt;
Starts at: &lt;br /&gt;
&lt;br /&gt;
File extension: .exe&lt;br /&gt;
&lt;br /&gt;
==Commodore==&lt;br /&gt;
===PRG===&lt;br /&gt;
System: CBM-DOS (Commodore, e.g. C64)&lt;br /&gt;
&lt;br /&gt;
Header: 2 bytes (= start address)&lt;br /&gt;
&lt;br /&gt;
Native size unit: Blocks (256 bytes including 2 bytes linking to next block)&lt;br /&gt;
&lt;br /&gt;
Loads to: given address in header&lt;br /&gt;
&lt;br /&gt;
Starts at: given address in header&lt;br /&gt;
&lt;br /&gt;
File extension: .prg&lt;br /&gt;
&lt;br /&gt;
===P00===&lt;br /&gt;
System: CBM-DOS / PC64 Emulator&lt;br /&gt;
&lt;br /&gt;
Header: extended 26 bytes; also includes the name; see [http://unusedino.de/ec64/technical/formats/pc64.html here]&lt;br /&gt;
&lt;br /&gt;
Native size unit: Blocks&lt;br /&gt;
&lt;br /&gt;
Loads to: given address in header&lt;br /&gt;
&lt;br /&gt;
Starts at: given address in header&lt;br /&gt;
&lt;br /&gt;
File extension: .p00&lt;br /&gt;
&lt;br /&gt;
==Atari 8bit==&lt;br /&gt;
===XEX, EXE, COM===&lt;br /&gt;
System: Atari&lt;br /&gt;
&lt;br /&gt;
Header: 6 bytes or more (FF FF &amp;lt;start address&amp;gt; &amp;lt;end address&amp;gt;); see also [https://www.atarimax.com/jindroush.atari.org/afmtexe.html here]&lt;br /&gt;
&lt;br /&gt;
Native size unit: ???&lt;br /&gt;
&lt;br /&gt;
Loads to: given start address in header&lt;br /&gt;
&lt;br /&gt;
Starts at: given end address in header&lt;br /&gt;
&lt;br /&gt;
File extension: .exe .com .xex (any ending possible)&lt;br /&gt;
&lt;br /&gt;
==Atari ST==&lt;br /&gt;
===TOS===&lt;br /&gt;
System: Atari ST&lt;br /&gt;
&lt;br /&gt;
Header: 32 Bytes &lt;br /&gt;
&lt;br /&gt;
Native size unit: ???&lt;br /&gt;
&lt;br /&gt;
Loads to: &lt;br /&gt;
&lt;br /&gt;
Starts at:  &lt;br /&gt;
&lt;br /&gt;
File extension:  &lt;br /&gt;
&lt;br /&gt;
==Amstrad==&lt;br /&gt;
===BIN===&lt;br /&gt;
System: AMSDOS (Amstrad CPC)&lt;br /&gt;
&lt;br /&gt;
Header: 128 bytes (includes filename, start address, end address, etc.; 95 unused bytes; see also [https://www.cpcwiki.eu/index.php/AMSDOS_Header AMSDOS-Header]&lt;br /&gt;
&lt;br /&gt;
Native size unit: kb &lt;br /&gt;
&lt;br /&gt;
Loads to: given start address in header&lt;br /&gt;
&lt;br /&gt;
Starts at: given end address in header&lt;br /&gt;
&lt;br /&gt;
File extension: .bin (on PC)&lt;br /&gt;
&lt;br /&gt;
==Spectrum==&lt;br /&gt;
===Binary===&lt;br /&gt;
System: ZX Spectrum&lt;br /&gt;
&lt;br /&gt;
Header: none&lt;br /&gt;
&lt;br /&gt;
Native size unit: ???&lt;br /&gt;
&lt;br /&gt;
Loads to: special loader required; usually a BASIC program&lt;br /&gt;
&lt;br /&gt;
Starts at: see above&lt;br /&gt;
&lt;br /&gt;
File extension: ??? usually delivered within a disk image (.trd)&lt;/div&gt;</summary>
		<author><name>Logiker</name></author>	</entry>

	<entry>
		<id>http://www.sizecoding.org/index.php?title=File_format&amp;diff=992</id>
		<title>File format</title>
		<link rel="alternate" type="text/html" href="http://www.sizecoding.org/index.php?title=File_format&amp;diff=992"/>
				<updated>2021-12-29T10:43:51Z</updated>
		
		<summary type="html">&lt;p&gt;Logiker: initial version of file formats&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;=File formats=&lt;br /&gt;
&lt;br /&gt;
File formats describe the content of a file. &lt;br /&gt;
&lt;br /&gt;
This page is not about:&lt;br /&gt;
* File systems which organize files on a partition&lt;br /&gt;
* Disk images which save a (disk) file system within one file&lt;br /&gt;
* Tape file formats, as they have a higher overhead usually&lt;br /&gt;
&lt;br /&gt;
==MS-DOS==&lt;br /&gt;
===COM===&lt;br /&gt;
System: MS-DOS&lt;br /&gt;
&lt;br /&gt;
Header: 0 bytes see [https://en.wikipedia.org/wiki/COM_file here]&lt;br /&gt;
&lt;br /&gt;
Native size unit: Bytes&lt;br /&gt;
&lt;br /&gt;
Loads to: 0100h&lt;br /&gt;
&lt;br /&gt;
Starts at: &lt;br /&gt;
&lt;br /&gt;
File extension: .com&lt;br /&gt;
&lt;br /&gt;
==Commodore==&lt;br /&gt;
===PRG===&lt;br /&gt;
System: CBM-DOS (Commodore, e.g. C64)&lt;br /&gt;
&lt;br /&gt;
Header: 2 bytes (= start address)&lt;br /&gt;
&lt;br /&gt;
Native size unit: Blocks (256 bytes including 2 bytes linking to next block)&lt;br /&gt;
&lt;br /&gt;
Loads to: given address in header&lt;br /&gt;
&lt;br /&gt;
Starts at: given address in header&lt;br /&gt;
&lt;br /&gt;
File extension: .prg&lt;br /&gt;
&lt;br /&gt;
===P00===&lt;br /&gt;
System: CBM-DOS / PC64 Emulator&lt;br /&gt;
&lt;br /&gt;
Header: extended 26 bytes; also includes the name; see [http://unusedino.de/ec64/technical/formats/pc64.html here]&lt;br /&gt;
&lt;br /&gt;
Native size unit: Blocks&lt;br /&gt;
&lt;br /&gt;
Loads to: given address in header&lt;br /&gt;
&lt;br /&gt;
Starts at: given address in header&lt;br /&gt;
&lt;br /&gt;
File extension: .p00&lt;br /&gt;
&lt;br /&gt;
==Atari==&lt;br /&gt;
===XEX, EXE, COM===&lt;br /&gt;
System: Atari&lt;br /&gt;
&lt;br /&gt;
Header: 6 bytes or more (FF FF &amp;lt;start address&amp;gt; &amp;lt;end address&amp;gt;); see also [https://www.atarimax.com/jindroush.atari.org/afmtexe.html here]&lt;br /&gt;
&lt;br /&gt;
Native size unit: ???&lt;br /&gt;
&lt;br /&gt;
Loads to: given start address in header&lt;br /&gt;
&lt;br /&gt;
Starts at: given end address in header&lt;br /&gt;
&lt;br /&gt;
File extension: .exe .com .xex (any ending possible)&lt;br /&gt;
&lt;br /&gt;
==Amstrad==&lt;br /&gt;
===BIN===&lt;br /&gt;
System: AMSDOS (Amstrad CPC)&lt;br /&gt;
&lt;br /&gt;
Header: 128 bytes (includes filename, start address, end address, etc.; 95 unused bytes; see also [https://www.cpcwiki.eu/index.php/AMSDOS_Header AMSDOS-Header]&lt;br /&gt;
&lt;br /&gt;
Native size unit: kb &lt;br /&gt;
&lt;br /&gt;
Loads to: given start address in header&lt;br /&gt;
&lt;br /&gt;
Starts at: given end address in header&lt;br /&gt;
&lt;br /&gt;
File extension: .bin (on PC)&lt;br /&gt;
&lt;br /&gt;
==Spectrum==&lt;br /&gt;
===Binary===&lt;br /&gt;
System: ZX Spectrum&lt;br /&gt;
&lt;br /&gt;
Header: none&lt;br /&gt;
&lt;br /&gt;
Native size unit: ???&lt;br /&gt;
&lt;br /&gt;
Loads to: special loader required; usually a BASIC program&lt;br /&gt;
&lt;br /&gt;
Starts at: see above&lt;br /&gt;
&lt;br /&gt;
File extension: ??? usually delivered within a disk image (.trd)&lt;/div&gt;</summary>
		<author><name>Logiker</name></author>	</entry>

	<entry>
		<id>http://www.sizecoding.org/index.php?title=Z80&amp;diff=990</id>
		<title>Z80</title>
		<link rel="alternate" type="text/html" href="http://www.sizecoding.org/index.php?title=Z80&amp;diff=990"/>
				<updated>2021-12-28T08:40:12Z</updated>
		
		<summary type="html">&lt;p&gt;Logiker: cpc emus added&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== Introduction ==&lt;br /&gt;
Wanting to start sizecoding on a Z80 platform in this day and age can be tough. &lt;br /&gt;
&lt;br /&gt;
So here is a bit of help to get you started:&lt;br /&gt;
&lt;br /&gt;
=== Registers ===&lt;br /&gt;
The Z80 can be seen as the little 8-bit brother of X86 chipsets, with many similarities.&lt;br /&gt;
If you are coming from a X86 background, this might help you get a bit more grip on the Z80.&lt;br /&gt;
These are the register pairs of the Z80, as seen from a X86 programmers perspective.&lt;br /&gt;
&lt;br /&gt;
* AF = AL + Flags&lt;br /&gt;
* HL = Can be seen as BX (H=BH,L=BL) or SI in a (HL) setting, like BX also used for addressing.&lt;br /&gt;
* BC = Can be seen as CX (B=CH,C=CL), often used for loops &lt;br /&gt;
* DE = Can be seen as DX (D=DH,E=DL) or DI in a (DE) setting&lt;br /&gt;
* IX = 16 bit Index Register X, can also be accessed with IXH,IXL &lt;br /&gt;
* IY = 16 bit Index Register Y, can also be accessed with IYH,IYL&lt;br /&gt;
&lt;br /&gt;
For each of the main registers there also exists a shadow register. These cannot be accessed directly, but must be swapped in and out with the main register set. The shadow registers are usually denoted by the ' symbol. They can be swapped with the following commands:&lt;br /&gt;
* EX AF,AF' = Swaps AF with AF'&lt;br /&gt;
* EXX = Swaps BC, DE and HL with BC', DE' and HL' &lt;br /&gt;
There are no shadow registers for the index registers.&lt;br /&gt;
&lt;br /&gt;
Note: For a lot of operations, you can only use the A(8bit) and HL(16bit) registers. &lt;br /&gt;
The Sjasmplus assembler doesn't really do proper syntax checking for this so beware.&lt;br /&gt;
&lt;br /&gt;
=== Instructions ===&lt;br /&gt;
Here is a rough translation for some of the Z80 instructions:&lt;br /&gt;
&lt;br /&gt;
* BIT = TEST&lt;br /&gt;
* CP = CMP  (although the Z80 has many other handy compare functionality)&lt;br /&gt;
* DJNZ = LOOP (decreases B and checks not zero)&lt;br /&gt;
* EXE = Exchange all registers with Shadow registers, can be used a bit like PUSHA/POPA&lt;br /&gt;
* EX = XCHG&lt;br /&gt;
* HALT = HLT&lt;br /&gt;
* JP = JMP&lt;br /&gt;
* JR = JMP NEAR (Jump Relative)&lt;br /&gt;
* LD = MOV&lt;br /&gt;
* LDI = MOVSB   (tmp=(HL),(DE)=tmp, DE++, HL++)&lt;br /&gt;
* LDIR = REP MOVSB   (tmp=(HL),(DE)=tmp, DE++, HL++, BC--)&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== Learning Z80 Assembler ===&lt;br /&gt;
There are many Z80 tutorials available online, but one i found very simple and clear is at this 1996 styled webpage ;-)  &lt;br /&gt;
&lt;br /&gt;
* http://www.z80.info/lesson1.htm&lt;br /&gt;
* http://www.z80.info/lesson2.htm&lt;br /&gt;
* http://www.z80.info/lesson3.htm&lt;br /&gt;
* http://www.z80.info/lesson4.htm&lt;br /&gt;
* http://www.z80.info/lesson5.htm&lt;br /&gt;
&lt;br /&gt;
There is no proper index-page for this, which is why i linked all the lessons above, but you can continue to the next lesson by clicking at the next lesson at the bottom of the page.&lt;br /&gt;
&lt;br /&gt;
Also, here is a compact 'cheat sheet' with some basics for various Z80 systems:&lt;br /&gt;
https://www.chibiakumas.com/z80/CheatSheet.pdf&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== ZX Spectrum  ==&lt;br /&gt;
The ZX Spectrum consists of a Z80A @ 3.5 MHz CPU with either 16k, 48k or 128K of RAM. Most demos are targeted at the Spectrum 128 because it includes more memory, a shadow screen buffer and an AY soundchip. The different models have slightly different timings - this will cause issues if you are doing cycle-exact effects like multi-color.&lt;br /&gt;
&lt;br /&gt;
=== Setting up ===&lt;br /&gt;
Setting up your development platform for the ZX Spectrum is quite easy, first get the following tools:&lt;br /&gt;
&lt;br /&gt;
* Assembler: SJASMPLUS -This assembler has nice macros for creating Binaries and SNA snapshot files out of the box. You can download it at https://sourceforge.net/projects/sjasmplus/&lt;br /&gt;
* Pasmo - for the .TAP create. Available at : http://pasmo.speccy.org&lt;br /&gt;
* Emulator(s): I Found [https://www.zophar.net/sinclair/zx-spin.html ZX Sping], [https://sourceforge.net/projects/fuse-emulator/ FUSE], [https://sourceforge.net/projects/unrealspeccyp/ UnrealSpeccy] and [https://www.aptanet.org/eightyone/ EightyOne] to work best for my usecase. Most emulators can read TAP, SNA and TRD files out of the box.&lt;br /&gt;
&lt;br /&gt;
=== Start values ===&lt;br /&gt;
Upon startup (when called from basic), the following values can assumed:&lt;br /&gt;
&lt;br /&gt;
* The alternate HL register is set to 0x2758&lt;br /&gt;
* BC = start address&lt;br /&gt;
* A = C&lt;br /&gt;
&lt;br /&gt;
=== Video display ===&lt;br /&gt;
Video display on the ZX Spectrum is mostly CPU based with little hardware features. No hardware sprites, no specific text or video modes, only a 256x192 byte screenbuffer with 1bit pixeldata located at $4000 in memory. &lt;br /&gt;
It is ordened a bit strange in 3 sections of 256x64 pixels, then character rows, then subrows.&lt;br /&gt;
&lt;br /&gt;
Address = 010RRLLL RRRCCCCC &lt;br /&gt;
&lt;br /&gt;
* where RRRRR is the row number (0..23)&lt;br /&gt;
* CCCCC is the column number (0..31)&lt;br /&gt;
* LLL is the line number within the cell (0..7)&lt;br /&gt;
&lt;br /&gt;
Calculating a screen address from XY coordinates is complicated due to the weird screen layout. In a larger demo you would generate a lookup table - it's usually best to avoid such calculations in small demos, but it can be done in under 30 bytes, eg: http://www.breakintoprogram.co.uk/computers/zx-spectrum/screen-memory-layout&lt;br /&gt;
&lt;br /&gt;
==== Adding Color ====&lt;br /&gt;
The ZX Spectrum has a 32x24 colormap located at $5800 where you can write color information for each 8x8 tile. &lt;br /&gt;
It has has 8 colors (INK and PAPER) with 2 brightness settings that can be set like this.&lt;br /&gt;
&lt;br /&gt;
color = brightness(64) | (PAPER&amp;lt;&amp;lt;3) | INK&lt;br /&gt;
&lt;br /&gt;
Because updating pixel memory can be slow, especially when you are grasping for bytes, some of the tiny intros on the zx spectrum prefer to use the colorram for the effect, sometimes in combination with an overlaying pattern.&lt;br /&gt;
&lt;br /&gt;
==== Border Color ====&lt;br /&gt;
You can set the border color to any of the 8 colors with:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;z80&amp;quot;&amp;gt;&lt;br /&gt;
ld a,0 ; bottom three bits of a contain the color&lt;br /&gt;
out (254),a&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Memory Configuration ===&lt;br /&gt;
128K separated to 8 pages (16384 bytes size)&lt;br /&gt;
Default configuration is:&lt;br /&gt;
&lt;br /&gt;
: page 5: $4000-$7fff&lt;br /&gt;
: page 2: $8000-$Bfff&lt;br /&gt;
: page 0: $C000-$Ffff&lt;br /&gt;
&lt;br /&gt;
There are two screens - page 7 and page 5.&lt;br /&gt;
port $7FFD allow to control memory and screens:&lt;br /&gt;
: bits 0-2 - page number mapped to memory at $C0000&lt;br /&gt;
: bit 3 - Select page 5(0) or page 7(1) to be displayed.&lt;br /&gt;
: bit 4 - ROM Select. 0-128K,1-48K&lt;br /&gt;
&lt;br /&gt;
Example of use&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;z80&amp;quot;&amp;gt;&lt;br /&gt;
loop: ei&lt;br /&gt;
 halt&lt;br /&gt;
pg: ld a,$17&lt;br /&gt;
 ld bc,$7ffd&lt;br /&gt;
 out (c),a&lt;br /&gt;
 xor $0A&lt;br /&gt;
 ld (pg+1),a&lt;br /&gt;
... do something with $C000-$DB00&lt;br /&gt;
 jp loop&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
$17 is use 48K, map page 7&lt;br /&gt;
After xor $0A we'll get value $1D(use 48K ROM, display screen at page 7 and map page5 at $C000).This is so-called &amp;quot;double buffering&amp;quot;.&lt;br /&gt;
See also : https://worldofspectrum.org/faq/reference/128kreference.htm&lt;br /&gt;
&lt;br /&gt;
==== Getting something on screen ====&lt;br /&gt;
Now to get something on screen, lets fill our colorram with a simple AND pattern, like so:&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;z80&amp;quot;&amp;gt;&lt;br /&gt;
 ld de,5800h&lt;br /&gt;
 ld b,24&lt;br /&gt;
yloop:&lt;br /&gt;
   ld c,32&lt;br /&gt;
xloop:&lt;br /&gt;
   ld a,c&lt;br /&gt;
   and b&lt;br /&gt;
   and 7    ; make sure range is 0..7&lt;br /&gt;
   ld (de),a&lt;br /&gt;
   inc de&lt;br /&gt;
   dec c&lt;br /&gt;
   jr nz,xloop&lt;br /&gt;
djnz yloop&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==== Using a Backbuffer ====&lt;br /&gt;
While the above code will run fine, you might want to consider using a backbuffer for more complex stuff. You can then simply write to another adress define by BACKBUFFER (for example A000) and copy the buffer to colorram like so:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;z80&amp;quot;&amp;gt;&lt;br /&gt;
halt               ; synchronize &lt;br /&gt;
ld hl,BACKBUFFER   &lt;br /&gt;
ld de,5800h&lt;br /&gt;
ld bc,768&lt;br /&gt;
ldir&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Another alternative method is to use the 128's memory paging, which provides a second screen buffer. This buffer is located at a different memeory location, but otherwise it is the same:&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;z80&amp;quot;&amp;gt;&lt;br /&gt;
	; main loop starts here&lt;br /&gt;
	ld	a,00010111b	; set up memory banks and screen here&lt;br /&gt;
mainloop&lt;br /&gt;
	halt			; sync&lt;br /&gt;
	xor	00001010b	; flip screens&lt;br /&gt;
	out	($fd),a&lt;br /&gt;
	push	af&lt;br /&gt;
&lt;br /&gt;
	; render code goes here&lt;br /&gt;
	; screen buffer is location at 0xC000 instead of 0x4000&lt;br /&gt;
&lt;br /&gt;
	pop	af&lt;br /&gt;
	jr	mainloop&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==== Overlaying simple graphics ====&lt;br /&gt;
If you don't want to use a solid color/tile for. &lt;br /&gt;
You could copy a single tile across the screen at startup for some flair.&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;z80&amp;quot;&amp;gt;&lt;br /&gt;
   ld a,0x55   ; 01010101 pattern&lt;br /&gt;
   ld bc,0x1800&lt;br /&gt;
copyloop:&lt;br /&gt;
   ld (de),a&lt;br /&gt;
   inc de&lt;br /&gt;
   dec c&lt;br /&gt;
jr nz,copyloop&lt;br /&gt;
djnz copyloop&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Alternatively you could generate a pattern using logic operations or random noise/data.&lt;br /&gt;
==== Useful routines ====&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;z80&amp;quot;&amp;gt;&lt;br /&gt;
;calculate address of next line,HL=address&lt;br /&gt;
down_hl:&lt;br /&gt;
 INC h&lt;br /&gt;
 LD A,h&lt;br /&gt;
 AND 7&lt;br /&gt;
 RET NZ&lt;br /&gt;
 LD A,L&lt;br /&gt;
 ADD A,#20&lt;br /&gt;
 LD L,A&lt;br /&gt;
 RET C&lt;br /&gt;
 LD A,H&lt;br /&gt;
 SUB 8&lt;br /&gt;
 LD H,A&lt;br /&gt;
 RET&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;z80&amp;quot;&amp;gt;&lt;br /&gt;
;move up at screen, HL=address&lt;br /&gt;
up_hl&lt;br /&gt;
     LD A,H&lt;br /&gt;
     DEC H&lt;br /&gt;
     AND 7&lt;br /&gt;
     ret nz&lt;br /&gt;
     LD A,L&lt;br /&gt;
     SUB 32&lt;br /&gt;
     LD L,A&lt;br /&gt;
     ret c&lt;br /&gt;
     LD A,H&lt;br /&gt;
     ADD A,8&lt;br /&gt;
     LD H,A&lt;br /&gt;
 ret&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;z80&amp;quot;&amp;gt;&lt;br /&gt;
;write pixel&lt;br /&gt;
 CALL  8933 ; C=X(0..255),B=Y(0..175),5C7D=COORDS&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;z80&amp;quot;&amp;gt;&lt;br /&gt;
;Calculate vertical line screen Address, IN : A=Y coordinate, OUT : HL=address&lt;br /&gt;
py2saddr:&lt;br /&gt;
        ld l,a&lt;br /&gt;
;	ld a,l&lt;br /&gt;
	and $07&lt;br /&gt;
	ld h,a&lt;br /&gt;
	ld a,l&lt;br /&gt;
	and $c0&lt;br /&gt;
	rra&lt;br /&gt;
	inc a&lt;br /&gt;
	rrca&lt;br /&gt;
	rrca&lt;br /&gt;
	or h&lt;br /&gt;
	ld h,a&lt;br /&gt;
	ld a,l&lt;br /&gt;
	add a&lt;br /&gt;
	add a&lt;br /&gt;
	and $e0&lt;br /&gt;
	ld l,a&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;z80&amp;quot;&amp;gt;&lt;br /&gt;
;Calculate Attribute address, IB: reg D=Y,reg E=X, OUT: HL=address, destroys DE&lt;br /&gt;
 ld l,d&lt;br /&gt;
 add hl,hl&lt;br /&gt;
 add hl,hl&lt;br /&gt;
 ld h,$11&lt;br /&gt;
 add hl,hl&lt;br /&gt;
 add hl,hl&lt;br /&gt;
 add hl,hl&lt;br /&gt;
 ld d,0&lt;br /&gt;
 add hl,de&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
or alter version&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;z80&amp;quot;&amp;gt;&lt;br /&gt;
;H=Y coordinate,L=X coordinate&lt;br /&gt;
	ld a,h&lt;br /&gt;
	rrca&lt;br /&gt;
	rrca&lt;br /&gt;
	rrca&lt;br /&gt;
	push af&lt;br /&gt;
	and 3&lt;br /&gt;
	add a,$58&lt;br /&gt;
	ld h,a&lt;br /&gt;
	pop af&lt;br /&gt;
	and %11100000&lt;br /&gt;
	add a,l&lt;br /&gt;
	ld l,a&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
calculate Pixel coordinate&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;z80&amp;quot;&amp;gt;&lt;br /&gt;
;IN: A=X coordinate,C=L=Y coordinate&lt;br /&gt;
;OUT: HL=screen address,A=bit value&lt;br /&gt;
call #22B0&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Sound ===&lt;br /&gt;
The original Spectrum has only a 1 bit sound capability (BEEP) through its internal speaker.&lt;br /&gt;
Later models included the AY-3-8910 Soundchip which provides 3 channels of PSG sound.&lt;br /&gt;
&lt;br /&gt;
==== Make some noise - Beeper ====&lt;br /&gt;
Setting/toggling bit 4 of port 254 will enable the beeper speaker.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;z80&amp;quot;&amp;gt;&lt;br /&gt;
		ld a,$10	;Bit 4 set&lt;br /&gt;
beeploop:	xor $10		;toggle Bit 4&lt;br /&gt;
		out (254),a&lt;br /&gt;
		ld b,90		;wait&lt;br /&gt;
		djnz $&lt;br /&gt;
		jp beeploop&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
Note that the bottom three bits of port 254 also set the border color (see above).&lt;br /&gt;
&lt;br /&gt;
==== Make some noise - AY ====&lt;br /&gt;
You can access the AY soundchip by outputting to the following ports:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;z80&amp;quot;&amp;gt;&lt;br /&gt;
ld bc,0xfffd&lt;br /&gt;
ld a, ay register number&lt;br /&gt;
out (c),a&lt;br /&gt;
ld b,0xbf	&lt;br /&gt;
ld a, data byte&lt;br /&gt;
out (c),a&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
For more information about the soundchip, check out:&lt;br /&gt;
https://www.atarimagazines.com/v4n7/stsound.html&lt;br /&gt;
&lt;br /&gt;
=== Small demos with documented source code ===&lt;br /&gt;
* Ceci N'est Pas Un Cube by Ate Bit https://www.pouet.net/prod.php?which=29691&lt;br /&gt;
* Zxwister by Ate Bit https://www.pouet.net/prod.php?which=44123&lt;br /&gt;
* Muse by Ate Bit https://www.pouet.net/prod.php?which=62880&lt;br /&gt;
* Starlet Guitarlet by HOOY-PROGRAM https://www.pouet.net/prod.php?which=52553&lt;br /&gt;
* Clangers On The Dancefloor by HOOY-PROGRAM https://www.pouet.net/prod.php?which=29696&lt;br /&gt;
* Chessington World Of Adventure by HOOY-PROGRAM https://www.pouet.net/prod.php?which=76074&lt;br /&gt;
* Roll Me Gently by Joker https://www.pouet.net/prod.php?which=86338&lt;br /&gt;
&lt;br /&gt;
=== Additional Resources ===&lt;br /&gt;
I found resources on ZX Spectrum sizecoding to be sparse.&lt;br /&gt;
* All kinds of Z80 Information http://www.z80.info/index.htm&lt;br /&gt;
* Another source for good Z80 Information http://z80-heaven.wikidot.com&lt;br /&gt;
* Assembler subforum on world of spectrum https://worldofspectrum.org/forums/categories/assembler&lt;br /&gt;
* Development subforum on Spectrum Computing https://spectrumcomputing.co.uk/forums/viewforum.php?f=6&lt;br /&gt;
* Blogpost on ZX Spectrum coding from a X86 coder's perspective on superogue's sizecdoing blog http://marquee.revival-studios.com/blog/blog_fluxus.html&lt;br /&gt;
* 128byte/256 byte zx spectrum productions by goblinish https://www.pouet.net/groups.php?which=11696&amp;amp;order=type&lt;br /&gt;
* 128byte/256 byte zx spectrum productions by gasman https://www.pouet.net/groups.php?which=1218&amp;amp;order=type&lt;br /&gt;
* Easy to read list of all Z80 instructions (including undocumented ones) with size and timing information https://clrhome.org/table/&lt;br /&gt;
* Detailed information on the screen layout http://www.overtakenbyevents.com/lets-talk-about-the-zx-specrum-screen-layout/ http://www.overtakenbyevents.com/lets-talk-about-the-zx-specrum-screen-layout-part-two/ and http://www.overtakenbyevents.com/lets-talk-about-the-zx-specrum-screen-layout-part-three/&lt;br /&gt;
&lt;br /&gt;
== Amstrad CPC ==&lt;br /&gt;
The Amstrad consists of a Z80A @ 3.5 MHz CPU &lt;br /&gt;
&lt;br /&gt;
=== Setting up ===&lt;br /&gt;
Setting up:&lt;br /&gt;
&lt;br /&gt;
* Assembler: -&lt;br /&gt;
** The emulator [http://www.winape.net/ Winape] has an integrated [http://www.winape.net/help/assembler.html assembler]&lt;br /&gt;
&lt;br /&gt;
* Emulator(s): &lt;br /&gt;
** [http://www.winape.net/ Winape] is very accurate and includes an assembler / debugger&lt;br /&gt;
** [https://www.cpc-power.com/cpcarchives/index.php?page=articles&amp;amp;num=445 Caprice] gets very regular updates&lt;br /&gt;
** [http://cngsoft.no-ip.org/cpcec.htm CPCEC] is very fast&lt;br /&gt;
** [https://sourceforge.net/projects/javacpc/ JavaCPC] offers many features&lt;br /&gt;
** [https://www.retrovirtualmachine.org/ Retro Virtual Machine] is visually very impressiv&lt;br /&gt;
&lt;br /&gt;
=== Video Display ===&lt;br /&gt;
No information yet&lt;br /&gt;
&lt;br /&gt;
=== Sound ===&lt;br /&gt;
No information yet&lt;br /&gt;
&lt;br /&gt;
=== Additional Resources ===&lt;br /&gt;
* 64 NOPs Amstrad CPC Tech Blog - https://64nops.wordpress.com/&lt;/div&gt;</summary>
		<author><name>Logiker</name></author>	</entry>

	<entry>
		<id>http://www.sizecoding.org/index.php?title=Christmas_Tree&amp;diff=989</id>
		<title>Christmas Tree</title>
		<link rel="alternate" type="text/html" href="http://www.sizecoding.org/index.php?title=Christmas_Tree&amp;diff=989"/>
				<updated>2021-12-28T07:47:27Z</updated>
		
		<summary type="html">&lt;p&gt;Logiker: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;[[Category:Case Study]]&lt;br /&gt;
==The challenge==&lt;br /&gt;
During the [https://demozoo.org/parties/4398/ Vintage Computing Christmas Challenge 2021] the goal was to create the shape of a given Christmas tree with as few bytes as possible. All platforms and languages were allowed.&lt;br /&gt;
The tree should be centered and look exactly like shown bellow.&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
                          *&lt;br /&gt;
                         ***&lt;br /&gt;
                        *****&lt;br /&gt;
                       *******&lt;br /&gt;
                         ***&lt;br /&gt;
                       *******&lt;br /&gt;
                     ***********&lt;br /&gt;
                   ***************&lt;br /&gt;
                        ***** &lt;br /&gt;
                     *********** &lt;br /&gt;
                  ***************** &lt;br /&gt;
               *********************** &lt;br /&gt;
                         ***&lt;br /&gt;
                         ***&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
There were mainly two kinds of approaches:&lt;br /&gt;
* calculate stars using a formula&lt;br /&gt;
* save amount of stars within data&lt;br /&gt;
Do to the trunk of the tree, the second type was more efficient. &lt;br /&gt;
==Winning Entries==&lt;br /&gt;
=== Shortest DOS version ===&lt;br /&gt;
The shortest DOS version with 44 bytes came from Hellmood:&lt;br /&gt;
&amp;lt;syntaxhighlight lang=nasm&amp;gt;&lt;br /&gt;
org 100h			; define start of code for data access&lt;br /&gt;
db 80				; screen width, located at [SI], also &amp;quot;push ax&amp;quot;&lt;br /&gt;
mov bx,d			; pointer to data for XLAT&lt;br /&gt;
mov cx,1120			; 14 lines with 80 chars each&lt;br /&gt;
X: mov ax,cx		; get current sequence position&lt;br /&gt;
div byte [si]		; transform to [X,Y] in AL, AH&lt;br /&gt;
xlat				; get tree width for current line number&lt;br /&gt;
sub ah,40			; center tree in the middle&lt;br /&gt;
jnc F				; - &lt;br /&gt;
neg ah				; -&lt;br /&gt;
F: sub ah,al		; inside or outside tree?&lt;br /&gt;
salc				; set AL depending on carry flag&lt;br /&gt;
imul ax,byte -42	; transform into STAR or nothing&lt;br /&gt;
int 29h				; write current char to screen&lt;br /&gt;
loop X				; repeat unil all chars are plotter&lt;br /&gt;
ret					; return to prompt (JMP to former AX=0x0000)&lt;br /&gt;
d:db 2,2,12,9,6,3,8,6,4,2,4,3,2,1&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
=== Winning entry for C64 ===&lt;br /&gt;
The shortest entry overall was for the C64 and was submitted by Serato with only 37 bytes:&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;6502&amp;quot;&amp;gt;&lt;br /&gt;
		!cpu 6510			; enable unintended opcodes in ACME assembler&lt;br /&gt;
&lt;br /&gt;
		chrout = $FFD2&lt;br /&gt;
		crlf = $AAD7&lt;br /&gt;
		pntr = $D3&lt;br /&gt;
		width = 40&lt;br /&gt;
&lt;br /&gt;
		;; BASIC header&lt;br /&gt;
		*= $0801&lt;br /&gt;
		!word +, 10&lt;br /&gt;
		!byte $9e&lt;br /&gt;
		!text &amp;quot;2092&amp;quot;&lt;br /&gt;
		!byte 0&lt;br /&gt;
+		!word 0&lt;br /&gt;
table&lt;br /&gt;
		!byte -1  &lt;br /&gt;
		!byte -3  &lt;br /&gt;
		!byte -5  &lt;br /&gt;
		!byte -7  &lt;br /&gt;
		!byte -3  &lt;br /&gt;
		!byte -7  &lt;br /&gt;
		!byte -11 &lt;br /&gt;
		!byte -15 &lt;br /&gt;
		!byte -5  &lt;br /&gt;
		!byte -11 &lt;br /&gt;
		!byte -17 &lt;br /&gt;
		!byte -23 &lt;br /&gt;
		!byte -3  &lt;br /&gt;
		!byte -3  &lt;br /&gt;
code&lt;br /&gt;
--		lsr&lt;br /&gt;
		sbc #(128-width/2)&lt;br /&gt;
		sta pntr&lt;br /&gt;
		lda #'*'&lt;br /&gt;
-		jsr chrout&lt;br /&gt;
		inx&lt;br /&gt;
		bne -&lt;br /&gt;
		jsr crlf&lt;br /&gt;
		iny&lt;br /&gt;
entry&lt;br /&gt;
		lax table,y&lt;br /&gt;
		bmi --&lt;br /&gt;
		rts&lt;br /&gt;
end&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
Serato's entry was provided with the following comments:&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;This entry to the Christmas Tree challenge saves space in six ways:&lt;br /&gt;
&lt;br /&gt;
 1. Using the c64 kernal routines to output individual characters and carriage return/linefeed. These routines save/restore X/Y allowing the registers to be used as loop counters.&lt;br /&gt;
&lt;br /&gt;
 2. Writing to the PNTR kernal variable to indent each row.&lt;br /&gt;
&lt;br /&gt;
 3. Using the unintended LAX opcode to simultaneously load A and X with the table values.&lt;br /&gt;
&lt;br /&gt;
 4. Storing the row widths as 2's complement negative values, to simplify the indent calculation to divide by two (LSR) and subtract (SBC). The inner loop simply counts back up to zero for rendering the correct width.&lt;br /&gt;
&lt;br /&gt;
 5. BASIC loads the Y register from address $30d. This defaults to 0 on startup, so Y does not need to be initialised.&lt;br /&gt;
&lt;br /&gt;
 6. Placing the table before the code in memory, the MSB of the table entries do not match the MSB of the first opcode (LSR), allowing the outer loop exit condition to be set implicitly in the Negative flag as the table values are read.&lt;br /&gt;
&lt;br /&gt;
These optimisations result in 37 bytes of machine code and data. Two further optimisations are possible each of which save 1 byte, but break the rules of this challenge:&lt;br /&gt;
&lt;br /&gt;
 a - LSR and SBC can be replaced with the unintended opcode ARR, if you are willing to &amp;quot;centre&amp;quot; the tree on a virtual screen width of 32 chars.&lt;br /&gt;
&lt;br /&gt;
 b - The BASIC interpreter leaves the line number in the zero page word at $39, so by setting the line number in the basic header to the address of the table, &amp;quot;LAX ($39),y&amp;quot; can be used for the table access.&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Optimized post-deadline versions==&lt;br /&gt;
===36 bytes version for C64===&lt;br /&gt;
The C64 version was shortened by altering the calculation so the default register values on start cause the first line to be drawn, shortening the table by one entry.&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;6502&amp;quot;&amp;gt;&lt;br /&gt;
		!cpu 6510			; enable unintended opcodes in ACME assembler&lt;br /&gt;
&lt;br /&gt;
		chrout = $FFD2&lt;br /&gt;
		crlf = $AAD7&lt;br /&gt;
		pntr = $D3&lt;br /&gt;
		width = 40&lt;br /&gt;
&lt;br /&gt;
		;; BASIC header&lt;br /&gt;
		*= $0801&lt;br /&gt;
		!word +, 10&lt;br /&gt;
		!byte $9e&lt;br /&gt;
		!text &amp;quot;2074&amp;quot;&lt;br /&gt;
		!byte 0&lt;br /&gt;
+		!word 0&lt;br /&gt;
table&lt;br /&gt;
;		!byte -1  &lt;br /&gt;
		!byte -3  &lt;br /&gt;
		!byte -5  &lt;br /&gt;
		!byte -7  &lt;br /&gt;
		!byte -3  &lt;br /&gt;
		!byte -7  &lt;br /&gt;
		!byte -11 &lt;br /&gt;
		!byte -15 &lt;br /&gt;
		!byte -5  &lt;br /&gt;
		!byte -11 &lt;br /&gt;
		!byte -17 &lt;br /&gt;
		!byte -23 &lt;br /&gt;
		!byte -3  &lt;br /&gt;
		!byte -3  &lt;br /&gt;
code&lt;br /&gt;
--		adc	#width-1&lt;br /&gt;
		lsr&lt;br /&gt;
		sta pntr&lt;br /&gt;
		lda #'*'&lt;br /&gt;
-		jsr chrout&lt;br /&gt;
		inx&lt;br /&gt;
		bmi -&lt;br /&gt;
		jsr crlf&lt;br /&gt;
		iny&lt;br /&gt;
		lax table-1,y&lt;br /&gt;
		bmi --&lt;br /&gt;
		rts&lt;br /&gt;
end&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===32 bytes version for ZX Spectrum===&lt;br /&gt;
After the deadline following entry for the ZX Spectrum with only 35 bytes was submitted by reddie and optimized by char to 32 bytes:&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;z80&amp;quot;&amp;gt;&lt;br /&gt;
# Christmas Tree post-event build, ZX Spectrum version&lt;br /&gt;
# tnx to Manwe for info about event, better late than never =)&lt;br /&gt;
# first version - 35 bytes - (c) reddie, 2021.12.25&lt;br /&gt;
# optimized to 32 bytes by char, 2021.12.26 - huge thanks from me!&lt;br /&gt;
# full final object len  = 32 bytes (from label &amp;quot;data&amp;quot; to label &amp;quot;end&amp;quot;)&lt;br /&gt;
# data array len  = 14 bytes; code len = 18 bytes, 13 Z80 instructions&lt;br /&gt;
# execute from Basic only! entry point  = 61455, or just run TRD image&lt;br /&gt;
# and then run &amp;quot;ctree32b&amp;quot; Basic-program, it will load &amp;amp; start the code&lt;br /&gt;
# TRD file also contains source text in ALASM format&lt;br /&gt;
&lt;br /&gt;
data	org	-16*256+1&lt;br /&gt;
	defb	-5,-5,-25,-19,-13,-7,-17,-13,-9,-5,-9,-7,-5,-3&lt;br /&gt;
&lt;br /&gt;
start	dec	c&lt;br /&gt;
	jr	z,$	;stop when finished&lt;br /&gt;
	ld	a,23	;set coords via ROM procedure&lt;br /&gt;
	rst	16&lt;br /&gt;
	ld	a,(bc)	;line len in negative format&lt;br /&gt;
	ld	e,a&lt;br /&gt;
	rra&lt;br /&gt;
	sub	b	;centering&lt;br /&gt;
print	rst	16&lt;br /&gt;
	ld	a,&amp;quot;*&amp;quot;&lt;br /&gt;
	inc	e&lt;br /&gt;
	jr	nz,print&lt;br /&gt;
	jr	start&lt;br /&gt;
end&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;/div&gt;</summary>
		<author><name>Logiker</name></author>	</entry>

	<entry>
		<id>http://www.sizecoding.org/index.php?title=Christmas_Tree&amp;diff=982</id>
		<title>Christmas Tree</title>
		<link rel="alternate" type="text/html" href="http://www.sizecoding.org/index.php?title=Christmas_Tree&amp;diff=982"/>
				<updated>2021-12-27T07:39:12Z</updated>
		
		<summary type="html">&lt;p&gt;Logiker: /* 32 bytes version for ZX Spectrum */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;[[Category:Case Study]]&lt;br /&gt;
During the [https://demozoo.org/parties/4398/ Vintage Computing Christmas Challenge 2021] the goal was to create the shape of a given Christmas tree with as few bytes as possible. All platforms and languages were allowed.&lt;br /&gt;
The tree should be centered and look exactly like shown bellow.&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
                          *&lt;br /&gt;
                         ***&lt;br /&gt;
                        *****&lt;br /&gt;
                       *******&lt;br /&gt;
                         ***&lt;br /&gt;
                       *******&lt;br /&gt;
                     ***********&lt;br /&gt;
                   ***************&lt;br /&gt;
                        ***** &lt;br /&gt;
                     *********** &lt;br /&gt;
                  ***************** &lt;br /&gt;
               *********************** &lt;br /&gt;
                         ***&lt;br /&gt;
                         ***&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
There were mainly two kinds of approaches:&lt;br /&gt;
* calculate stars using a formula&lt;br /&gt;
* save amount of stars within data&lt;br /&gt;
Do to the trunk of the tree, the second type was more efficient. &lt;br /&gt;
=== Shortest DOS version ===&lt;br /&gt;
The shortest DOS version with 44 bytes came from Hellmood:&lt;br /&gt;
&amp;lt;syntaxhighlight lang=nasm&amp;gt;&lt;br /&gt;
org 100h			; define start of code for data access&lt;br /&gt;
db 80				; screen width, located at [SI], also &amp;quot;push ax&amp;quot;&lt;br /&gt;
mov bx,d			; pointer to data for XLAT&lt;br /&gt;
mov cx,1120			; 14 lines with 80 chars each&lt;br /&gt;
X: mov ax,cx		; get current sequence position&lt;br /&gt;
div byte [si]		; transform to [X,Y] in AL, AH&lt;br /&gt;
xlat				; get tree width for current line number&lt;br /&gt;
sub ah,40			; center tree in the middle&lt;br /&gt;
jnc F				; - &lt;br /&gt;
neg ah				; -&lt;br /&gt;
F: sub ah,al		; inside or outside tree?&lt;br /&gt;
salc				; set AL depending on carry flag&lt;br /&gt;
imul ax,byte -42	; transform into STAR or nothing&lt;br /&gt;
int 29h				; write current char to screen&lt;br /&gt;
loop X				; repeat unil all chars are plotter&lt;br /&gt;
ret					; return to prompt (JMP to former AX=0x0000)&lt;br /&gt;
d:db 2,2,12,9,6,3,8,6,4,2,4,3,2,1&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
=== Winning entry for C64 ===&lt;br /&gt;
The shortest entry overall was for the C64 and was submitted by Serato with only 37 bytes:&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;6502&amp;quot;&amp;gt;&lt;br /&gt;
		!cpu 6510			; enable unintended opcodes in ACME assembler&lt;br /&gt;
&lt;br /&gt;
		chrout = $FFD2&lt;br /&gt;
		crlf = $AAD7&lt;br /&gt;
		pntr = $D3&lt;br /&gt;
		width = 40&lt;br /&gt;
&lt;br /&gt;
		;; BASIC header&lt;br /&gt;
		*= $0801&lt;br /&gt;
		!word +, 10&lt;br /&gt;
		!byte $9e&lt;br /&gt;
		!text &amp;quot;2092&amp;quot;&lt;br /&gt;
		!byte 0&lt;br /&gt;
+		!word 0&lt;br /&gt;
table&lt;br /&gt;
		!byte -1  &lt;br /&gt;
		!byte -3  &lt;br /&gt;
		!byte -5  &lt;br /&gt;
		!byte -7  &lt;br /&gt;
		!byte -3  &lt;br /&gt;
		!byte -7  &lt;br /&gt;
		!byte -11 &lt;br /&gt;
		!byte -15 &lt;br /&gt;
		!byte -5  &lt;br /&gt;
		!byte -11 &lt;br /&gt;
		!byte -17 &lt;br /&gt;
		!byte -23 &lt;br /&gt;
		!byte -3  &lt;br /&gt;
		!byte -3  &lt;br /&gt;
code&lt;br /&gt;
--		lsr&lt;br /&gt;
		sbc #(128-width/2)&lt;br /&gt;
		sta pntr&lt;br /&gt;
		lda #'*'&lt;br /&gt;
-		jsr chrout&lt;br /&gt;
		inx&lt;br /&gt;
		bne -&lt;br /&gt;
		jsr crlf&lt;br /&gt;
		iny&lt;br /&gt;
entry&lt;br /&gt;
		lax table,y&lt;br /&gt;
		bmi --&lt;br /&gt;
		rts&lt;br /&gt;
end&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
Serato's entry was provided with the following comments:&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;This entry to the Christmas Tree challenge saves space in six ways:&lt;br /&gt;
&lt;br /&gt;
 1. Using the c64 kernal routines to output individual characters and carriage return/linefeed. These routines save/restore X/Y allowing the registers to be used as loop counters.&lt;br /&gt;
&lt;br /&gt;
 2. Writing to the PNTR kernal variable to indent each row.&lt;br /&gt;
&lt;br /&gt;
 3. Using the unintended LAX opcode to simultaneously load A and X with the table values.&lt;br /&gt;
&lt;br /&gt;
 4. Storing the row widths as 2's complement negative values, to simplify the indent calculation to divide by two (LSR) and subtract (SBC). The inner loop simply counts back up to zero for rendering the correct width.&lt;br /&gt;
&lt;br /&gt;
 5. BASIC loads the Y register from address $30d. This defaults to 0 on startup, so Y does not need to be initialised.&lt;br /&gt;
&lt;br /&gt;
 6. Placing the table before the code in memory, the MSB of the table entries do not match the MSB of the first opcode (LSR), allowing the outer loop exit condition to be set implicitly in the Negative flag as the table values are read.&lt;br /&gt;
&lt;br /&gt;
These optimisations result in 37 bytes of machine code and data. Two further optimisations are possible each of which save 1 byte, but break the rules of this challenge:&lt;br /&gt;
&lt;br /&gt;
 a - LSR and SBC can be replaced with the unintended opcode ARR, if you are willing to &amp;quot;centre&amp;quot; the tree on a virtual screen width of 32 chars.&lt;br /&gt;
&lt;br /&gt;
 b - The BASIC interpreter leaves the line number in the zero page word at $39, so by setting the line number in the basic header to the address of the table, &amp;quot;LAX ($39),y&amp;quot; can be used for the table access.&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===32 bytes version for ZX Spectrum===&lt;br /&gt;
After the deadline following entry for the ZX Spectrum with only 35 bytes was submitted by reddie and optimized by char to 32 bytes:&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;z80&amp;quot;&amp;gt;&lt;br /&gt;
# Christmas Tree post-event build, ZX Spectrum version&lt;br /&gt;
# tnx to Manwe for info about event, better late than never =)&lt;br /&gt;
# first version - 35 bytes - (c) reddie, 2021.12.25&lt;br /&gt;
# optimized to 32 bytes by char, 2021.12.26 - huge thanks from me!&lt;br /&gt;
# full final object len  = 32 bytes (from label &amp;quot;data&amp;quot; to label &amp;quot;end&amp;quot;)&lt;br /&gt;
# data array len  = 14 bytes; code len = 18 bytes, 13 Z80 instructions&lt;br /&gt;
# execute from Basic only! entry point  = 61455, or just run TRD image&lt;br /&gt;
# and then run &amp;quot;ctree32b&amp;quot; Basic-program, it will load &amp;amp; start the code&lt;br /&gt;
# TRD file also contains source text in ALASM format&lt;br /&gt;
&lt;br /&gt;
data	org	-16*256+1&lt;br /&gt;
	defb	-5,-5,-25,-19,-13,-7,-17,-13,-9,-5,-9,-7,-5,-3&lt;br /&gt;
&lt;br /&gt;
start	dec	c&lt;br /&gt;
	jr	z,$	;stop when finished&lt;br /&gt;
	ld	a,23	;set coords via ROM procedure&lt;br /&gt;
	rst	16&lt;br /&gt;
	ld	a,(bc)	;line len in negative format&lt;br /&gt;
	ld	e,a&lt;br /&gt;
	rra&lt;br /&gt;
	sub	b	;centering&lt;br /&gt;
print	rst	16&lt;br /&gt;
	ld	a,&amp;quot;*&amp;quot;&lt;br /&gt;
	inc	e&lt;br /&gt;
	jr	nz,print&lt;br /&gt;
	jr	start&lt;br /&gt;
end&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;/div&gt;</summary>
		<author><name>Logiker</name></author>	</entry>

	<entry>
		<id>http://www.sizecoding.org/index.php?title=Christmas_Tree&amp;diff=981</id>
		<title>Christmas Tree</title>
		<link rel="alternate" type="text/html" href="http://www.sizecoding.org/index.php?title=Christmas_Tree&amp;diff=981"/>
				<updated>2021-12-27T07:37:10Z</updated>
		
		<summary type="html">&lt;p&gt;Logiker: /* 35 bytes version for ZX Spectrum */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;[[Category:Case Study]]&lt;br /&gt;
During the [https://demozoo.org/parties/4398/ Vintage Computing Christmas Challenge 2021] the goal was to create the shape of a given Christmas tree with as few bytes as possible. All platforms and languages were allowed.&lt;br /&gt;
The tree should be centered and look exactly like shown bellow.&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
                          *&lt;br /&gt;
                         ***&lt;br /&gt;
                        *****&lt;br /&gt;
                       *******&lt;br /&gt;
                         ***&lt;br /&gt;
                       *******&lt;br /&gt;
                     ***********&lt;br /&gt;
                   ***************&lt;br /&gt;
                        ***** &lt;br /&gt;
                     *********** &lt;br /&gt;
                  ***************** &lt;br /&gt;
               *********************** &lt;br /&gt;
                         ***&lt;br /&gt;
                         ***&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
There were mainly two kinds of approaches:&lt;br /&gt;
* calculate stars using a formula&lt;br /&gt;
* save amount of stars within data&lt;br /&gt;
Do to the trunk of the tree, the second type was more efficient. &lt;br /&gt;
=== Shortest DOS version ===&lt;br /&gt;
The shortest DOS version with 44 bytes came from Hellmood:&lt;br /&gt;
&amp;lt;syntaxhighlight lang=nasm&amp;gt;&lt;br /&gt;
org 100h			; define start of code for data access&lt;br /&gt;
db 80				; screen width, located at [SI], also &amp;quot;push ax&amp;quot;&lt;br /&gt;
mov bx,d			; pointer to data for XLAT&lt;br /&gt;
mov cx,1120			; 14 lines with 80 chars each&lt;br /&gt;
X: mov ax,cx		; get current sequence position&lt;br /&gt;
div byte [si]		; transform to [X,Y] in AL, AH&lt;br /&gt;
xlat				; get tree width for current line number&lt;br /&gt;
sub ah,40			; center tree in the middle&lt;br /&gt;
jnc F				; - &lt;br /&gt;
neg ah				; -&lt;br /&gt;
F: sub ah,al		; inside or outside tree?&lt;br /&gt;
salc				; set AL depending on carry flag&lt;br /&gt;
imul ax,byte -42	; transform into STAR or nothing&lt;br /&gt;
int 29h				; write current char to screen&lt;br /&gt;
loop X				; repeat unil all chars are plotter&lt;br /&gt;
ret					; return to prompt (JMP to former AX=0x0000)&lt;br /&gt;
d:db 2,2,12,9,6,3,8,6,4,2,4,3,2,1&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
=== Winning entry for C64 ===&lt;br /&gt;
The shortest entry overall was for the C64 and was submitted by Serato with only 37 bytes:&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;6502&amp;quot;&amp;gt;&lt;br /&gt;
		!cpu 6510			; enable unintended opcodes in ACME assembler&lt;br /&gt;
&lt;br /&gt;
		chrout = $FFD2&lt;br /&gt;
		crlf = $AAD7&lt;br /&gt;
		pntr = $D3&lt;br /&gt;
		width = 40&lt;br /&gt;
&lt;br /&gt;
		;; BASIC header&lt;br /&gt;
		*= $0801&lt;br /&gt;
		!word +, 10&lt;br /&gt;
		!byte $9e&lt;br /&gt;
		!text &amp;quot;2092&amp;quot;&lt;br /&gt;
		!byte 0&lt;br /&gt;
+		!word 0&lt;br /&gt;
table&lt;br /&gt;
		!byte -1  &lt;br /&gt;
		!byte -3  &lt;br /&gt;
		!byte -5  &lt;br /&gt;
		!byte -7  &lt;br /&gt;
		!byte -3  &lt;br /&gt;
		!byte -7  &lt;br /&gt;
		!byte -11 &lt;br /&gt;
		!byte -15 &lt;br /&gt;
		!byte -5  &lt;br /&gt;
		!byte -11 &lt;br /&gt;
		!byte -17 &lt;br /&gt;
		!byte -23 &lt;br /&gt;
		!byte -3  &lt;br /&gt;
		!byte -3  &lt;br /&gt;
code&lt;br /&gt;
--		lsr&lt;br /&gt;
		sbc #(128-width/2)&lt;br /&gt;
		sta pntr&lt;br /&gt;
		lda #'*'&lt;br /&gt;
-		jsr chrout&lt;br /&gt;
		inx&lt;br /&gt;
		bne -&lt;br /&gt;
		jsr crlf&lt;br /&gt;
		iny&lt;br /&gt;
entry&lt;br /&gt;
		lax table,y&lt;br /&gt;
		bmi --&lt;br /&gt;
		rts&lt;br /&gt;
end&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
Serato's entry was provided with the following comments:&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;This entry to the Christmas Tree challenge saves space in six ways:&lt;br /&gt;
&lt;br /&gt;
 1. Using the c64 kernal routines to output individual characters and carriage return/linefeed. These routines save/restore X/Y allowing the registers to be used as loop counters.&lt;br /&gt;
&lt;br /&gt;
 2. Writing to the PNTR kernal variable to indent each row.&lt;br /&gt;
&lt;br /&gt;
 3. Using the unintended LAX opcode to simultaneously load A and X with the table values.&lt;br /&gt;
&lt;br /&gt;
 4. Storing the row widths as 2's complement negative values, to simplify the indent calculation to divide by two (LSR) and subtract (SBC). The inner loop simply counts back up to zero for rendering the correct width.&lt;br /&gt;
&lt;br /&gt;
 5. BASIC loads the Y register from address $30d. This defaults to 0 on startup, so Y does not need to be initialised.&lt;br /&gt;
&lt;br /&gt;
 6. Placing the table before the code in memory, the MSB of the table entries do not match the MSB of the first opcode (LSR), allowing the outer loop exit condition to be set implicitly in the Negative flag as the table values are read.&lt;br /&gt;
&lt;br /&gt;
These optimisations result in 37 bytes of machine code and data. Two further optimisations are possible each of which save 1 byte, but break the rules of this challenge:&lt;br /&gt;
&lt;br /&gt;
 a - LSR and SBC can be replaced with the unintended opcode ARR, if you are willing to &amp;quot;centre&amp;quot; the tree on a virtual screen width of 32 chars.&lt;br /&gt;
&lt;br /&gt;
 b - The BASIC interpreter leaves the line number in the zero page word at $39, so by setting the line number in the basic header to the address of the table, &amp;quot;LAX ($39),y&amp;quot; can be used for the table access.&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===32 bytes version for ZX Spectrum===&lt;br /&gt;
After the deadline following entry for the ZX Spectrum with only 35 bytes was submitted by reddie and improved by char:&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;z80&amp;quot;&amp;gt;&lt;br /&gt;
# Christmas Tree post-event build, ZX Spectrum version&lt;br /&gt;
# tnx to Manwe for info about event, better late than never =)&lt;br /&gt;
# first version - 35 bytes - (c) reddie, 2021.12.25&lt;br /&gt;
# optimized to 32 bytes by char, 2021.12.26 - huge thanks from me!&lt;br /&gt;
# full final object len  = 32 bytes (from label &amp;quot;data&amp;quot; to label &amp;quot;end&amp;quot;)&lt;br /&gt;
# data array len  = 14 bytes; code len = 18 bytes, 13 Z80 instructions&lt;br /&gt;
# execute from Basic only! entry point  = 61455, or just run TRD image&lt;br /&gt;
# and then run &amp;quot;ctree32b&amp;quot; Basic-program, it will load &amp;amp; start the code&lt;br /&gt;
# TRD file also contains source text in ALASM format&lt;br /&gt;
&lt;br /&gt;
data	org	-16*256+1&lt;br /&gt;
	defb	-5,-5,-25,-19,-13,-7,-17,-13,-9,-5,-9,-7,-5,-3&lt;br /&gt;
&lt;br /&gt;
start	dec	c&lt;br /&gt;
	jr	z,$	;stop when finished&lt;br /&gt;
	ld	a,23	;set coords via ROM procedure&lt;br /&gt;
	rst	16&lt;br /&gt;
	ld	a,(bc)	;line len in negative format&lt;br /&gt;
	ld	e,a&lt;br /&gt;
	rra&lt;br /&gt;
	sub	b	;centering&lt;br /&gt;
print	rst	16&lt;br /&gt;
	ld	a,&amp;quot;*&amp;quot;&lt;br /&gt;
	inc	e&lt;br /&gt;
	jr	nz,print&lt;br /&gt;
	jr	start&lt;br /&gt;
end&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;/div&gt;</summary>
		<author><name>Logiker</name></author>	</entry>

	<entry>
		<id>http://www.sizecoding.org/index.php?title=Christmas_Tree&amp;diff=980</id>
		<title>Christmas Tree</title>
		<link rel="alternate" type="text/html" href="http://www.sizecoding.org/index.php?title=Christmas_Tree&amp;diff=980"/>
				<updated>2021-12-26T21:03:02Z</updated>
		
		<summary type="html">&lt;p&gt;Logiker: /* 35 bytes version for ZX Spectrum */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;[[Category:Case Study]]&lt;br /&gt;
During the [https://demozoo.org/parties/4398/ Vintage Computing Christmas Challenge 2021] the goal was to create the shape of a given Christmas tree with as few bytes as possible. All platforms and languages were allowed.&lt;br /&gt;
The tree should be centered and look exactly like shown bellow.&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
                          *&lt;br /&gt;
                         ***&lt;br /&gt;
                        *****&lt;br /&gt;
                       *******&lt;br /&gt;
                         ***&lt;br /&gt;
                       *******&lt;br /&gt;
                     ***********&lt;br /&gt;
                   ***************&lt;br /&gt;
                        ***** &lt;br /&gt;
                     *********** &lt;br /&gt;
                  ***************** &lt;br /&gt;
               *********************** &lt;br /&gt;
                         ***&lt;br /&gt;
                         ***&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
There were mainly two kinds of approaches:&lt;br /&gt;
* calculate stars using a formula&lt;br /&gt;
* save amount of stars within data&lt;br /&gt;
Do to the trunk of the tree, the second type was more efficient. &lt;br /&gt;
=== Shortest DOS version ===&lt;br /&gt;
The shortest DOS version with 44 bytes came from Hellmood:&lt;br /&gt;
&amp;lt;syntaxhighlight lang=nasm&amp;gt;&lt;br /&gt;
org 100h			; define start of code for data access&lt;br /&gt;
db 80				; screen width, located at [SI], also &amp;quot;push ax&amp;quot;&lt;br /&gt;
mov bx,d			; pointer to data for XLAT&lt;br /&gt;
mov cx,1120			; 14 lines with 80 chars each&lt;br /&gt;
X: mov ax,cx		; get current sequence position&lt;br /&gt;
div byte [si]		; transform to [X,Y] in AL, AH&lt;br /&gt;
xlat				; get tree width for current line number&lt;br /&gt;
sub ah,40			; center tree in the middle&lt;br /&gt;
jnc F				; - &lt;br /&gt;
neg ah				; -&lt;br /&gt;
F: sub ah,al		; inside or outside tree?&lt;br /&gt;
salc				; set AL depending on carry flag&lt;br /&gt;
imul ax,byte -42	; transform into STAR or nothing&lt;br /&gt;
int 29h				; write current char to screen&lt;br /&gt;
loop X				; repeat unil all chars are plotter&lt;br /&gt;
ret					; return to prompt (JMP to former AX=0x0000)&lt;br /&gt;
d:db 2,2,12,9,6,3,8,6,4,2,4,3,2,1&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
=== Winning entry for C64 ===&lt;br /&gt;
The shortest entry overall was for the C64 and was submitted by Serato with only 37 bytes:&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;6502&amp;quot;&amp;gt;&lt;br /&gt;
		!cpu 6510			; enable unintended opcodes in ACME assembler&lt;br /&gt;
&lt;br /&gt;
		chrout = $FFD2&lt;br /&gt;
		crlf = $AAD7&lt;br /&gt;
		pntr = $D3&lt;br /&gt;
		width = 40&lt;br /&gt;
&lt;br /&gt;
		;; BASIC header&lt;br /&gt;
		*= $0801&lt;br /&gt;
		!word +, 10&lt;br /&gt;
		!byte $9e&lt;br /&gt;
		!text &amp;quot;2092&amp;quot;&lt;br /&gt;
		!byte 0&lt;br /&gt;
+		!word 0&lt;br /&gt;
table&lt;br /&gt;
		!byte -1  &lt;br /&gt;
		!byte -3  &lt;br /&gt;
		!byte -5  &lt;br /&gt;
		!byte -7  &lt;br /&gt;
		!byte -3  &lt;br /&gt;
		!byte -7  &lt;br /&gt;
		!byte -11 &lt;br /&gt;
		!byte -15 &lt;br /&gt;
		!byte -5  &lt;br /&gt;
		!byte -11 &lt;br /&gt;
		!byte -17 &lt;br /&gt;
		!byte -23 &lt;br /&gt;
		!byte -3  &lt;br /&gt;
		!byte -3  &lt;br /&gt;
code&lt;br /&gt;
--		lsr&lt;br /&gt;
		sbc #(128-width/2)&lt;br /&gt;
		sta pntr&lt;br /&gt;
		lda #'*'&lt;br /&gt;
-		jsr chrout&lt;br /&gt;
		inx&lt;br /&gt;
		bne -&lt;br /&gt;
		jsr crlf&lt;br /&gt;
		iny&lt;br /&gt;
entry&lt;br /&gt;
		lax table,y&lt;br /&gt;
		bmi --&lt;br /&gt;
		rts&lt;br /&gt;
end&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
Serato's entry was provided with the following comments:&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;This entry to the Christmas Tree challenge saves space in six ways:&lt;br /&gt;
&lt;br /&gt;
 1. Using the c64 kernal routines to output individual characters and carriage return/linefeed. These routines save/restore X/Y allowing the registers to be used as loop counters.&lt;br /&gt;
&lt;br /&gt;
 2. Writing to the PNTR kernal variable to indent each row.&lt;br /&gt;
&lt;br /&gt;
 3. Using the unintended LAX opcode to simultaneously load A and X with the table values.&lt;br /&gt;
&lt;br /&gt;
 4. Storing the row widths as 2's complement negative values, to simplify the indent calculation to divide by two (LSR) and subtract (SBC). The inner loop simply counts back up to zero for rendering the correct width.&lt;br /&gt;
&lt;br /&gt;
 5. BASIC loads the Y register from address $30d. This defaults to 0 on startup, so Y does not need to be initialised.&lt;br /&gt;
&lt;br /&gt;
 6. Placing the table before the code in memory, the MSB of the table entries do not match the MSB of the first opcode (LSR), allowing the outer loop exit condition to be set implicitly in the Negative flag as the table values are read.&lt;br /&gt;
&lt;br /&gt;
These optimisations result in 37 bytes of machine code and data. Two further optimisations are possible each of which save 1 byte, but break the rules of this challenge:&lt;br /&gt;
&lt;br /&gt;
 a - LSR and SBC can be replaced with the unintended opcode ARR, if you are willing to &amp;quot;centre&amp;quot; the tree on a virtual screen width of 32 chars.&lt;br /&gt;
&lt;br /&gt;
 b - The BASIC interpreter leaves the line number in the zero page word at $39, so by setting the line number in the basic header to the address of the table, &amp;quot;LAX ($39),y&amp;quot; can be used for the table access.&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===35 bytes version for ZX Spectrum===&lt;br /&gt;
After the deadline following entry for the ZX Spectrum with only 35 bytes was submitted by reddie:&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;z80&amp;quot;&amp;gt;&lt;br /&gt;
# Christmas Tree post-event build (c) reddie, 2021.12.25, ZX Spectrum version&lt;br /&gt;
# tnx to Manwe for info about event, better late than never =)&lt;br /&gt;
# full object len  = 35 bytes (end-data)&lt;br /&gt;
# data array len  = 14 bytes; code len = 21 bytes, 15 Z80 instructions&lt;br /&gt;
# execute from Basic only! entry point  = 61455, or just run TRD image&lt;br /&gt;
# TRD file also contains source text in ALASM format&lt;br /&gt;
&lt;br /&gt;
data	org	-16*256+1&lt;br /&gt;
	defb	-3,-3,-23,-17,-11,-5,-15,-11,-7,-3,-7,-5,-3,-1&lt;br /&gt;
&lt;br /&gt;
start	dec	c&lt;br /&gt;
	jr	z,$	;stop when finished&lt;br /&gt;
	ld	a,23	;set coords via ROM procedure&lt;br /&gt;
	rst	16&lt;br /&gt;
	ld	a,(bc)	;line len in negative format&lt;br /&gt;
	ld	e,a&lt;br /&gt;
	sra	a&lt;br /&gt;
	sub	b	;centering&lt;br /&gt;
	rst	16&lt;br /&gt;
	rst	16&lt;br /&gt;
print	ld	a,&amp;quot;*&amp;quot;&lt;br /&gt;
	rst	16&lt;br /&gt;
	inc	e&lt;br /&gt;
	jr	nz,print&lt;br /&gt;
	jr	start&lt;br /&gt;
end&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;/div&gt;</summary>
		<author><name>Logiker</name></author>	</entry>

	<entry>
		<id>http://www.sizecoding.org/index.php?title=Christmas_Tree&amp;diff=979</id>
		<title>Christmas Tree</title>
		<link rel="alternate" type="text/html" href="http://www.sizecoding.org/index.php?title=Christmas_Tree&amp;diff=979"/>
				<updated>2021-12-26T21:00:21Z</updated>
		
		<summary type="html">&lt;p&gt;Logiker: Added ZX Spectrum version&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;[[Category:Case Study]]&lt;br /&gt;
During the [https://demozoo.org/parties/4398/ Vintage Computing Christmas Challenge 2021] the goal was to create the shape of a given Christmas tree with as few bytes as possible. All platforms and languages were allowed.&lt;br /&gt;
The tree should be centered and look exactly like shown bellow.&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
                          *&lt;br /&gt;
                         ***&lt;br /&gt;
                        *****&lt;br /&gt;
                       *******&lt;br /&gt;
                         ***&lt;br /&gt;
                       *******&lt;br /&gt;
                     ***********&lt;br /&gt;
                   ***************&lt;br /&gt;
                        ***** &lt;br /&gt;
                     *********** &lt;br /&gt;
                  ***************** &lt;br /&gt;
               *********************** &lt;br /&gt;
                         ***&lt;br /&gt;
                         ***&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
There were mainly two kinds of approaches:&lt;br /&gt;
* calculate stars using a formula&lt;br /&gt;
* save amount of stars within data&lt;br /&gt;
Do to the trunk of the tree, the second type was more efficient. &lt;br /&gt;
=== Shortest DOS version ===&lt;br /&gt;
The shortest DOS version with 44 bytes came from Hellmood:&lt;br /&gt;
&amp;lt;syntaxhighlight lang=nasm&amp;gt;&lt;br /&gt;
org 100h			; define start of code for data access&lt;br /&gt;
db 80				; screen width, located at [SI], also &amp;quot;push ax&amp;quot;&lt;br /&gt;
mov bx,d			; pointer to data for XLAT&lt;br /&gt;
mov cx,1120			; 14 lines with 80 chars each&lt;br /&gt;
X: mov ax,cx		; get current sequence position&lt;br /&gt;
div byte [si]		; transform to [X,Y] in AL, AH&lt;br /&gt;
xlat				; get tree width for current line number&lt;br /&gt;
sub ah,40			; center tree in the middle&lt;br /&gt;
jnc F				; - &lt;br /&gt;
neg ah				; -&lt;br /&gt;
F: sub ah,al		; inside or outside tree?&lt;br /&gt;
salc				; set AL depending on carry flag&lt;br /&gt;
imul ax,byte -42	; transform into STAR or nothing&lt;br /&gt;
int 29h				; write current char to screen&lt;br /&gt;
loop X				; repeat unil all chars are plotter&lt;br /&gt;
ret					; return to prompt (JMP to former AX=0x0000)&lt;br /&gt;
d:db 2,2,12,9,6,3,8,6,4,2,4,3,2,1&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
=== Winning entry for C64 ===&lt;br /&gt;
The shortest entry overall was for the C64 and was submitted by Serato with only 37 bytes:&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;6502&amp;quot;&amp;gt;&lt;br /&gt;
		!cpu 6510			; enable unintended opcodes in ACME assembler&lt;br /&gt;
&lt;br /&gt;
		chrout = $FFD2&lt;br /&gt;
		crlf = $AAD7&lt;br /&gt;
		pntr = $D3&lt;br /&gt;
		width = 40&lt;br /&gt;
&lt;br /&gt;
		;; BASIC header&lt;br /&gt;
		*= $0801&lt;br /&gt;
		!word +, 10&lt;br /&gt;
		!byte $9e&lt;br /&gt;
		!text &amp;quot;2092&amp;quot;&lt;br /&gt;
		!byte 0&lt;br /&gt;
+		!word 0&lt;br /&gt;
table&lt;br /&gt;
		!byte -1  &lt;br /&gt;
		!byte -3  &lt;br /&gt;
		!byte -5  &lt;br /&gt;
		!byte -7  &lt;br /&gt;
		!byte -3  &lt;br /&gt;
		!byte -7  &lt;br /&gt;
		!byte -11 &lt;br /&gt;
		!byte -15 &lt;br /&gt;
		!byte -5  &lt;br /&gt;
		!byte -11 &lt;br /&gt;
		!byte -17 &lt;br /&gt;
		!byte -23 &lt;br /&gt;
		!byte -3  &lt;br /&gt;
		!byte -3  &lt;br /&gt;
code&lt;br /&gt;
--		lsr&lt;br /&gt;
		sbc #(128-width/2)&lt;br /&gt;
		sta pntr&lt;br /&gt;
		lda #'*'&lt;br /&gt;
-		jsr chrout&lt;br /&gt;
		inx&lt;br /&gt;
		bne -&lt;br /&gt;
		jsr crlf&lt;br /&gt;
		iny&lt;br /&gt;
entry&lt;br /&gt;
		lax table,y&lt;br /&gt;
		bmi --&lt;br /&gt;
		rts&lt;br /&gt;
end&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
Serato's entry was provided with the following comments:&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;This entry to the Christmas Tree challenge saves space in six ways:&lt;br /&gt;
&lt;br /&gt;
 1. Using the c64 kernal routines to output individual characters and carriage return/linefeed. These routines save/restore X/Y allowing the registers to be used as loop counters.&lt;br /&gt;
&lt;br /&gt;
 2. Writing to the PNTR kernal variable to indent each row.&lt;br /&gt;
&lt;br /&gt;
 3. Using the unintended LAX opcode to simultaneously load A and X with the table values.&lt;br /&gt;
&lt;br /&gt;
 4. Storing the row widths as 2's complement negative values, to simplify the indent calculation to divide by two (LSR) and subtract (SBC). The inner loop simply counts back up to zero for rendering the correct width.&lt;br /&gt;
&lt;br /&gt;
 5. BASIC loads the Y register from address $30d. This defaults to 0 on startup, so Y does not need to be initialised.&lt;br /&gt;
&lt;br /&gt;
 6. Placing the table before the code in memory, the MSB of the table entries do not match the MSB of the first opcode (LSR), allowing the outer loop exit condition to be set implicitly in the Negative flag as the table values are read.&lt;br /&gt;
&lt;br /&gt;
These optimisations result in 37 bytes of machine code and data. Two further optimisations are possible each of which save 1 byte, but break the rules of this challenge:&lt;br /&gt;
&lt;br /&gt;
 a - LSR and SBC can be replaced with the unintended opcode ARR, if you are willing to &amp;quot;centre&amp;quot; the tree on a virtual screen width of 32 chars.&lt;br /&gt;
&lt;br /&gt;
 b - The BASIC interpreter leaves the line number in the zero page word at $39, so by setting the line number in the basic header to the address of the table, &amp;quot;LAX ($39),y&amp;quot; can be used for the table access.&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===35 bytes version for ZX Spectrum===&lt;br /&gt;
After the deadline following entry for the ZX Spectrum with only 35 bytes was submitted by reddie:&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;z80&amp;quot;&amp;gt;&lt;br /&gt;
; Christmas Tree post-event build (c) reddie, 2021.12.25, ZX Spectrum version&lt;br /&gt;
; tnx to Manwe for info about event, better late than never =)&lt;br /&gt;
; full object len  = 35 bytes (end-data)&lt;br /&gt;
; data array len  = 14 bytes; code len = 21 bytes, 15 Z80 instructions&lt;br /&gt;
; execute from Basic only! entry point  = 61455, or just run TRD image&lt;br /&gt;
; TRD file also contains source text in ALASM format&lt;br /&gt;
&lt;br /&gt;
data	org	-16*256+1&lt;br /&gt;
	defb	-3,-3,-23,-17,-11,-5,-15,-11,-7,-3,-7,-5,-3,-1&lt;br /&gt;
&lt;br /&gt;
start	dec	c&lt;br /&gt;
	jr	z,$	;stop when finished&lt;br /&gt;
	ld	a,23	;set coords via ROM procedure&lt;br /&gt;
	rst	16&lt;br /&gt;
	ld	a,(bc)	;line len in negative format&lt;br /&gt;
	ld	e,a&lt;br /&gt;
	sra	a&lt;br /&gt;
	sub	b	;centering&lt;br /&gt;
	rst	16&lt;br /&gt;
	rst	16&lt;br /&gt;
print	ld	a,&amp;quot;*&amp;quot;&lt;br /&gt;
	rst	16&lt;br /&gt;
	inc	e&lt;br /&gt;
	jr	nz,print&lt;br /&gt;
	jr	start&lt;br /&gt;
end&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;/div&gt;</summary>
		<author><name>Logiker</name></author>	</entry>

	<entry>
		<id>http://www.sizecoding.org/index.php?title=Christmas_Tree&amp;diff=975</id>
		<title>Christmas Tree</title>
		<link rel="alternate" type="text/html" href="http://www.sizecoding.org/index.php?title=Christmas_Tree&amp;diff=975"/>
				<updated>2021-12-25T18:42:02Z</updated>
		
		<summary type="html">&lt;p&gt;Logiker: Initial version of Christmas Tree case study&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;[[Category:Case Study]]&lt;br /&gt;
During the [https://demozoo.org/parties/4398/ Vintage Computing Christmas Challenge 2021] the goad was to create the shape of a given Christmas tree with as few bytes as possible. All platforms and languages were allowed.&lt;br /&gt;
The tree should be centered and look exactly like shown bellow.&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
                          *&lt;br /&gt;
                         ***&lt;br /&gt;
                        *****&lt;br /&gt;
                       *******&lt;br /&gt;
                         ***&lt;br /&gt;
                       *******&lt;br /&gt;
                     ***********&lt;br /&gt;
                   ***************&lt;br /&gt;
                        ***** &lt;br /&gt;
                     *********** &lt;br /&gt;
                  ***************** &lt;br /&gt;
               *********************** &lt;br /&gt;
                         ***&lt;br /&gt;
                         ***&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
There were mainly two kinds of approaches:&lt;br /&gt;
* calculate stars using a formula&lt;br /&gt;
* save amount of stars within data&lt;br /&gt;
Do to the trunk of the tree, the second type was more efficient. &lt;br /&gt;
=== Shortest DOS version ===&lt;br /&gt;
The shortest DOS version with 44 bytes came from Hellmood:&lt;br /&gt;
&amp;lt;syntaxhighlight lang=nasm&amp;gt;&lt;br /&gt;
org 100h			; define start of code for data access&lt;br /&gt;
db 80				; screen width, located at [SI], also &amp;quot;push ax&amp;quot;&lt;br /&gt;
mov bx,d			; pointer to data for XLAT&lt;br /&gt;
mov cx,1120			; 14 lines with 80 chars each&lt;br /&gt;
X: mov ax,cx		; get current sequence position&lt;br /&gt;
div byte [si]		; transform to [X,Y] in AL, AH&lt;br /&gt;
xlat				; get tree width for current line number&lt;br /&gt;
sub ah,40			; center tree in the middle&lt;br /&gt;
jnc F				; - &lt;br /&gt;
neg ah				; -&lt;br /&gt;
F: sub ah,al		; inside or outside tree?&lt;br /&gt;
salc				; set AL depending on carry flag&lt;br /&gt;
imul ax,byte -42	; transform into STAR or nothing&lt;br /&gt;
int 29h				; write current char to screen&lt;br /&gt;
loop X				; repeat unil all chars are plotter&lt;br /&gt;
ret					; return to prompt (JMP to former AX=0x0000)&lt;br /&gt;
d:db 2,2,12,9,6,3,8,6,4,2,4,3,2,1&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
=== Winning entry for C64 ===&lt;br /&gt;
The shortest entry overall was for the C64 and was submitted by Serato with only 37 bytes:&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;6502&amp;quot;&amp;gt;&lt;br /&gt;
		!cpu 6510			; enable unintended opcodes in ACME assembler&lt;br /&gt;
&lt;br /&gt;
		chrout = $FFD2&lt;br /&gt;
		crlf = $AAD7&lt;br /&gt;
		pntr = $D3&lt;br /&gt;
		width = 40&lt;br /&gt;
&lt;br /&gt;
		*=$304-39&lt;br /&gt;
table&lt;br /&gt;
		!byte width-1  &lt;br /&gt;
		!byte width-3  &lt;br /&gt;
		!byte width-5  &lt;br /&gt;
		!byte width-7  &lt;br /&gt;
		!byte width-3  &lt;br /&gt;
		!byte width-7  &lt;br /&gt;
		!byte width-11 &lt;br /&gt;
		!byte width-15 &lt;br /&gt;
		!byte width-5  &lt;br /&gt;
		!byte width-11 &lt;br /&gt;
		!byte width-17 &lt;br /&gt;
		!byte width-23 &lt;br /&gt;
		!byte width-3  &lt;br /&gt;
		!byte width-3  &lt;br /&gt;
entry&lt;br /&gt;
		lax	table-1,y&lt;br /&gt;
		bmi *&lt;br /&gt;
		lsr&lt;br /&gt;
		sta pntr&lt;br /&gt;
		lda #'*'&lt;br /&gt;
-		jsr chrout&lt;br /&gt;
		inx&lt;br /&gt;
		cpx #width&lt;br /&gt;
		bne -&lt;br /&gt;
		jsr crlf&lt;br /&gt;
		iny&lt;br /&gt;
		jmp entry&lt;br /&gt;
end&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;/div&gt;</summary>
		<author><name>Logiker</name></author>	</entry>

	<entry>
		<id>http://www.sizecoding.org/index.php?title=Case_Studies&amp;diff=974</id>
		<title>Case Studies</title>
		<link rel="alternate" type="text/html" href="http://www.sizecoding.org/index.php?title=Case_Studies&amp;diff=974"/>
				<updated>2021-12-25T18:39:11Z</updated>
		
		<summary type="html">&lt;p&gt;Logiker: Added Christmas Tree case study link&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;Sometimes it can be helpful to examine a tinyprog in detail, seeing what choices were made and why:&lt;br /&gt;
&lt;br /&gt;
:[[MELT.COM]]: We take a cute program from the 1980s and see how far we can crunch it down&lt;br /&gt;
&lt;br /&gt;
:[[m8trix 8b]]: An &amp;quot;Enter The Matrix&amp;quot; screen display in only 8 bytes&lt;br /&gt;
&lt;br /&gt;
:[[4is256]]: &amp;amp;#344;r&amp;amp;#345;ola's Tetris is a full tetris clone with scoring&lt;br /&gt;
&lt;br /&gt;
:[[paint16b]]: Hellmood's paint program in 16 bytes (really)&lt;br /&gt;
&lt;br /&gt;
:[[Indian Spirit]]: An American Indian tapestry with music in 32 bytes&lt;br /&gt;
&lt;br /&gt;
:[[Essence]]: Fakery of path tracing and lighting, with audio, in 64 bytes&lt;br /&gt;
&lt;br /&gt;
:[[Memories]]: Detailed writeup on [https://www.pouet.net/prod.php?which=85227 &amp;quot;Memories&amp;quot; (256 bytes)]&lt;br /&gt;
&lt;br /&gt;
:[[Game of Life 32b]]; Writeup for game of life in 32 bytes&lt;br /&gt;
&lt;br /&gt;
:[[Christmas Tree]]: Implementation of a Christmas Tree on several platforms &lt;br /&gt;
&lt;br /&gt;
== External Case Studies ==&lt;br /&gt;
&lt;br /&gt;
[https://en.wikipedia.org/wiki/Brainfuck Brainfuck] is a very tiny language, having only 8 commands and an instruction pointer.  Several compilers and interpreters have been made; Gynvael archived [http://gynvael.coldwind.pl/bf125/ many different versions along with their source code], the smallest of which was 125 bytes.  qkumba took that as inspiration and created his own [http://pferrie.epizy.com/misc/tiny/brainfck.htm brainfuck compiler in 100 bytes] (104 for one that is fully compliant).  (Note:  The term &amp;quot;compiler&amp;quot; is used mistakenly a lot in these descriptions; the majority of brainfuck programs are actually interpreters that load brainfuck programs and execute native code token by token.  This one is an exception in that it really does compile the code entirely into native instructions first.)&lt;br /&gt;
&lt;br /&gt;
[https://revival-studios.com/marquee/blog/blog_homogenic.html Small Beginnings: The development of Homogenic] Development Write up on [https://www.pouet.net/prod.php?which=84537 Homogenic, by: Marquee Design (256 bytes)]&lt;br /&gt;
&lt;br /&gt;
[https://revival-studios.com/marquee/blog/blog_nanorail.html Moving on: The development of Nanorail] Development Write up on [https://www.pouet.net/prod.php?which=84624 Nanorail, by: Marquee Design (256 bytes)]&lt;br /&gt;
&lt;br /&gt;
[https://revival-studios.com/marquee/blog/blog_enigma.html Full Circle: The development of Enigma] Development Write up on [https://www.pouet.net/prod.php?which=85232 Enigma, by: Marquee Design (256 bytes)]&lt;br /&gt;
&lt;br /&gt;
[https://revival-studios.com/marquee/blog/blog_microdose.html Crunching content: The development of Microdose] Development Write up on [https://www.pouet.net/prod.php?which=85677 Microdose, by: Marquee Design (128 bytes)]&lt;br /&gt;
&lt;br /&gt;
[https://abaddon.hu/crevenge/history.html The long journey to 1k real-time ray-tracing] Detailed technical writeup on [https://www.pouet.net/prod.php?which=87078 Chrome Revenge by Abaddon (1024 bytes)]&lt;br /&gt;
&lt;br /&gt;
[http://canonical.org/~kragen/demo/fr-016.html Disassembly of Farbrausch's &amp;quot;fr-016: bytes&amp;quot;]&lt;br /&gt;
&lt;br /&gt;
[http://canonical.org/~kragen/demo/klappquadrat.html A disassembly of the 64-byte version of Klappquadrat]&lt;br /&gt;
&lt;br /&gt;
[https://trixter.oldskool.org/2012/12/17/maze-generation-in-thirteen-bytes/ Maze generation in 10 bytes]&lt;/div&gt;</summary>
		<author><name>Logiker</name></author>	</entry>

	</feed>