<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:atom="http://www.w3.org/2005/Atom" version="2.0">
    <channel>
      <title>Code for humans</title>
      <link>https://lando.codeberg.page/</link>
      <description>blog about programing and art</description>
      <generator>Zola</generator>
      <language>en</language>
      <atom:link href="https://lando.codeberg.page/rss.xml" rel="self" type="application/rss+xml"/>
      <lastBuildDate>Fri, 16 Jan 2026 00:00:00 +0000</lastBuildDate>
      <item>
          <title>6502 days of christmas, day 1</title>
          <pubDate>Fri, 16 Jan 2026 00:00:00 +0000</pubDate>
          <author>Lando Schumpich</author>
          <link>https://lando.codeberg.page/blog/aocd1/</link>
          <guid>https://lando.codeberg.page/blog/aocd1/</guid>
          <description xml:base="https://lando.codeberg.page/blog/aocd1/">&lt;h2 id=&quot;day-1&quot;&gt;Day 1&lt;a class=&quot;post-anchor&quot; href=&quot;#day-1&quot; aria-label=&quot;Anchor link for: day-1&quot;&gt;&lt;span aria-hidden=&quot;true&quot;&gt;#&lt;&#x2F;span&gt;&lt;&#x2F;a&gt;
&lt;&#x2F;h2&gt;
&lt;p&gt;TODO&lt;&#x2F;p&gt;
</description>
      </item>
      <item>
          <title>6502 days of christmas</title>
          <pubDate>Wed, 14 Jan 2026 00:00:00 +0000</pubDate>
          <author>Lando Schumpich</author>
          <link>https://lando.codeberg.page/blog/advent-of-code-26/</link>
          <guid>https://lando.codeberg.page/blog/advent-of-code-26/</guid>
          <description xml:base="https://lando.codeberg.page/blog/advent-of-code-26/">&lt;h2 id=&quot;introduction&quot;&gt;Introduction&lt;a class=&quot;post-anchor&quot; href=&quot;#introduction&quot; aria-label=&quot;Anchor link for: introduction&quot;&gt;&lt;span aria-hidden=&quot;true&quot;&gt;#&lt;&#x2F;span&gt;&lt;&#x2F;a&gt;
&lt;&#x2F;h2&gt;
&lt;p&gt;I have been programming now for roughly 9 years and as with many developers, the longer I program, the lower I go in the stack. My personal journey went something like:&lt;&#x2F;p&gt;
&lt;ul&gt;
&lt;li&gt;Excel functions as a wee school kid&lt;&#x2F;li&gt;
&lt;li&gt;Html as a teenager to style personal pages in emerging social media (90s&#x2F;2000s)&lt;&#x2F;li&gt;
&lt;li&gt;10 years of no interest in coding whatsoever&lt;&#x2F;li&gt;
&lt;li&gt;Visual Programming in my studies, which lead to&lt;&#x2F;li&gt;
&lt;li&gt;Custom components written in &lt;code&gt;python&lt;&#x2F;code&gt;, which lead to&lt;&#x2F;li&gt;
&lt;li&gt;Compiled PlugIns written in &lt;code&gt;C#&lt;&#x2F;code&gt;, which lead to&lt;&#x2F;li&gt;
&lt;li&gt;Low-ish level libraries written in &lt;code&gt;rust&lt;&#x2F;code&gt;&lt;&#x2F;li&gt;
&lt;li&gt;Writing a &lt;code&gt;no_std&lt;&#x2F;code&gt; &lt;code&gt;chip-8&lt;&#x2F;code&gt; emulator in &lt;code&gt;rust&lt;&#x2F;code&gt; &amp;lt;- this is the lowest level I have gotten to&lt;&#x2F;li&gt;
&lt;&#x2F;ul&gt;
&lt;p&gt;where especially the &lt;code&gt;C#&lt;&#x2F;code&gt; experienced helped me then a lot to find my first coding jobs. But still, I never really ventured into even lower level languages like &lt;code&gt;C&lt;&#x2F;code&gt;, or &lt;code&gt;asm&lt;&#x2F;code&gt;.&lt;&#x2F;p&gt;
&lt;p&gt;So time to change that: For this (last) years &lt;a href=&quot;https:&#x2F;&#x2F;adventofcode.com&#x2F;2025&quot;&gt;advent of code&lt;&#x2F;a&gt; I decided to &lt;strong&gt;really&lt;&#x2F;strong&gt; challenge myself and do it in &lt;code&gt;6502 assembly&lt;&#x2F;code&gt;.&lt;&#x2F;p&gt;
&lt;h2 id=&quot;advent-of-code&quot;&gt;Advent of code&lt;a class=&quot;post-anchor&quot; href=&quot;#advent-of-code&quot; aria-label=&quot;Anchor link for: advent-of-code&quot;&gt;&lt;span aria-hidden=&quot;true&quot;&gt;#&lt;&#x2F;span&gt;&lt;&#x2F;a&gt;
&lt;&#x2F;h2&gt;
&lt;p&gt;My relationship with advent of code is so-so: I really like the idea, but I never had the time or interest to follow through with the full calendar. Also the timing kind of sucks, since december is one of the busiest months of the year for me.
So looking at the &lt;a href=&quot;https:&#x2F;&#x2F;lando.codeberg.page&#x2F;blog&#x2F;advent-of-code-26&#x2F;adventofcode.com&#x2F;2025&#x2F;events&quot;&gt;overview&lt;&#x2F;a&gt;, I managed to gather &lt;strong&gt;11&lt;&#x2F;strong&gt; 🌟 stars 🌟 over 2 years I participated in (not counting 2025). So don&#x27;t expect too much solved days out of this one, especially since I&#x27;m going in with exactly &lt;strong&gt;zero&lt;&#x2F;strong&gt; prior knowledge of assembly.&lt;&#x2F;p&gt;
&lt;h2 id=&quot;why-the-6502-assembly-flavour&quot;&gt;Why the 6502 assembly flavour?&lt;a class=&quot;post-anchor&quot; href=&quot;#why-the-6502-assembly-flavour&quot; aria-label=&quot;Anchor link for: why-the-6502-assembly-flavour&quot;&gt;&lt;span aria-hidden=&quot;true&quot;&gt;#&lt;&#x2F;span&gt;&lt;&#x2F;a&gt;
&lt;&#x2F;h2&gt;
&lt;p&gt;There are quite a lot different assembly languages one could learn and choosing a first one as an entry point was kind of overwhelming in the beginning. A &lt;em&gt;business-valid&lt;&#x2F;em&gt; choice would have been &lt;code&gt;x86-64&lt;&#x2F;code&gt;, since that is what all the pcs at my job are running. I decided against that, since 1: it&#x27;s boring to go for the most valuable move and 2: I read multiple times that this flavour of assembly is meant to be compiled to and &lt;strong&gt;not&lt;&#x2F;strong&gt; written by hand that much.&lt;&#x2F;p&gt;
&lt;p&gt;I looked into old chips that were actually programmed in assembly at their prime-time and the &lt;code&gt;6502&lt;&#x2F;code&gt; caught my attention. It was used in tons of systems, like f.e. the &lt;em&gt;Acorn Archimedes&lt;&#x2F;em&gt;, or the &lt;em&gt;Commodore 64&lt;&#x2F;em&gt; and learning it&#x27;s language could open up the skill to write &lt;em&gt;Nintendo Entertainment System (nes)&lt;&#x2F;em&gt; games, which just sounds great. Also the number of opcodes is low, which should translate into a short learning curve.&lt;&#x2F;p&gt;
&lt;h2 id=&quot;resources-for-learning-6502-assembly&quot;&gt;Resources for learning 6502 assembly&lt;a class=&quot;post-anchor&quot; href=&quot;#resources-for-learning-6502-assembly&quot; aria-label=&quot;Anchor link for: resources-for-learning-6502-assembly&quot;&gt;&lt;span aria-hidden=&quot;true&quot;&gt;#&lt;&#x2F;span&gt;&lt;&#x2F;a&gt;
&lt;&#x2F;h2&gt;
&lt;p&gt;There is a lot of very valuable information online if one can find it, as always:&lt;&#x2F;p&gt;
&lt;ul&gt;
&lt;li&gt;&lt;a href=&quot;http:&#x2F;&#x2F;www.6502.org&#x2F;&quot;&gt;6502.org&lt;&#x2F;a&gt; is a great starting point where I got most of my other ressources of&lt;&#x2F;li&gt;
&lt;li&gt;&lt;a href=&quot;https:&#x2F;&#x2F;www.masswerk.at&#x2F;6502&#x2F;6502_instruction_set.html&quot;&gt;masswerk.at&lt;&#x2F;a&gt; has an amazing overview of the 6502 opcodes, with all their gotchas and modes&lt;&#x2F;li&gt;
&lt;li&gt;&lt;a href=&quot;https:&#x2F;&#x2F;skilldrick.github.io&#x2F;easy6502&#x2F;&quot;&gt;easy6502&lt;&#x2F;a&gt; was the first ressource that really made it click for me. After going through with it I felt I got the basics down enough to write simple programs myself. Although the difficulty ramps up similarly to the &lt;a href=&quot;https:&#x2F;&#x2F;knowyourmeme.com&#x2F;photos&#x2F;572078-how-to-draw-an-owl&quot;&gt;how to draw an owl meme&lt;&#x2F;a&gt;&lt;&#x2F;li&gt;
&lt;li&gt;&lt;a href=&quot;https:&#x2F;&#x2F;6502.co.uk&#x2F;course&#x2F;build-a-6502-based-computer&quot;&gt;6502.co.uk&lt;&#x2F;a&gt; is on my backlog, if I want to dive deeper&lt;&#x2F;li&gt;
&lt;&#x2F;ul&gt;
&lt;h2 id=&quot;setting-up-my-dev-environment&quot;&gt;Setting up my dev environment&lt;a class=&quot;post-anchor&quot; href=&quot;#setting-up-my-dev-environment&quot; aria-label=&quot;Anchor link for: setting-up-my-dev-environment&quot;&gt;&lt;span aria-hidden=&quot;true&quot;&gt;#&lt;&#x2F;span&gt;&lt;&#x2F;a&gt;
&lt;&#x2F;h2&gt;
&lt;p&gt;This was quite annoying. The chip is old and a lot of tech for it was written quite a while ago, so the nice modern toolchains I&#x27;m used to were rarely available. Since I did not want to mess around with setting up a toolchain to build 90s&#x2F;2000s era C projects, I looked at hobbyist tooling developed more recently.&lt;&#x2F;p&gt;
&lt;p&gt;One project I found and used for day 1 of advent of code was the &lt;a href=&quot;https:&#x2F;&#x2F;docs.rs&#x2F;rs6502&#x2F;latest&#x2F;rs6502&#x2F;&quot;&gt;rs6502 crate&lt;&#x2F;a&gt;, since that one has an assembler I could use out of the box. Sadly I had some errors running the built-in &lt;code&gt;Cpu&lt;&#x2F;code&gt; emulator, so for emulation I use the &lt;a href=&quot;https:&#x2F;&#x2F;crates.io&#x2F;crates&#x2F;mos6502&quot;&gt;mos6502 crate&lt;&#x2F;a&gt;. There probably also are language servers, but since all the assemblers have slightly different flavours of the constructs they support on top of the standard opcodes, I did not bother and just wrote the assembly by hand.&lt;&#x2F;p&gt;
&lt;p&gt;During coding the solution for day 1 I quickly realized the need for a debugger, but I could not find one that was easy to install and use, so I postponed it, just printing out register states of the emulator after every instruction. Having a proper debugger from the start would have definitely saved time.&lt;&#x2F;p&gt;
&lt;p&gt;The assembler I used initially was very basic, so I ditched it after a while for the &lt;a href=&quot;https:&#x2F;&#x2F;github.com&#x2F;hlorenzi&#x2F;customasm&quot;&gt;customasm crate&lt;&#x2F;a&gt;, which &lt;em&gt;helpfully&lt;&#x2F;em&gt; includes a sample 6502 syntax in it&#x27;s examples!&lt;&#x2F;p&gt;
&lt;p&gt;The stack I ended up with is roughly:&lt;&#x2F;p&gt;
&lt;ul&gt;
&lt;li&gt;&lt;code&gt;mos6502&lt;&#x2F;code&gt; for emulating the 6502 cpu&lt;&#x2F;li&gt;
&lt;li&gt;&lt;code&gt;customasm&lt;&#x2F;code&gt; for assembling my handwritten assembly&lt;&#x2F;li&gt;
&lt;li&gt;A barebones debugger I begrudgingly coded alongside my assembly attempts, which supports viewing memory, breakpoints and steping back in time.&lt;&#x2F;li&gt;
&lt;&#x2F;ul&gt;
&lt;p&gt;&lt;img src=&quot;https:&#x2F;&#x2F;lando.codeberg.page&#x2F;processed_images&#x2F;6502_debugger_day3.cfc9d2b1c803461a.png&quot; alt=&quot;My Debugger&quot;
     width=&quot;1280&quot; height=&quot;680&quot;
     sizes=&quot;(min-width: 920px) 784px, (min-width: 700px) calc(82vw + 46px), calc(100vw - 40px)&quot; 
     srcset=&quot;https:&#x2F;&#x2F;lando.codeberg.page&#x2F;processed_images&#x2F;6502_debugger_day3.1d6176bed5b3c7fa.png 640w,
             https:&#x2F;&#x2F;lando.codeberg.page&#x2F;processed_images&#x2F;6502_debugger_day3.ad47c522d5b2ddf7.png 784w,
             https:&#x2F;&#x2F;lando.codeberg.page&#x2F;processed_images&#x2F;6502_debugger_day3.b2b4bd6f4df82da9.png 1280w,
             https:&#x2F;&#x2F;lando.codeberg.page&#x2F;processed_images&#x2F;6502_debugger_day3.4e0971befa4970d3.png 1920w&quot;
     loading=&quot;lazy&quot;&gt;

Here you can see the debugger stopped after calculating the result of day 3 part 1&lt;&#x2F;p&gt;
&lt;details&gt;
  &lt;summary&gt;Spoiler ahead&lt;&#x2F;summary&gt;
&lt;p&gt;it&#x27;s &lt;code&gt;0x4261&lt;&#x2F;code&gt; from memory addresses &lt;code&gt;0x0000&lt;&#x2F;code&gt; and &lt;code&gt;0x0001&lt;&#x2F;code&gt;&lt;&#x2F;p&gt;
&lt;&#x2F;details&gt;
&lt;h2 id=&quot;the-6502&quot;&gt;The 6502&lt;a class=&quot;post-anchor&quot; href=&quot;#the-6502&quot; aria-label=&quot;Anchor link for: the-6502&quot;&gt;&lt;span aria-hidden=&quot;true&quot;&gt;#&lt;&#x2F;span&gt;&lt;&#x2F;a&gt;
&lt;&#x2F;h2&gt;
&lt;p&gt;There are actually multiple versions of the chip, with the first one that saw wide adoption being the initial release of the &lt;code&gt;MOS MCS 6502&lt;&#x2F;code&gt;. Later versions apparently fixed some bugs and also added more opcodes, but I decided to stick to the &lt;code&gt;OC&lt;&#x2F;code&gt;.&lt;&#x2F;p&gt;
&lt;p&gt;All variants are &lt;em&gt;8-bit&lt;&#x2F;em&gt; by default, and through and through. That means all registers are only a single byte wide, with no way to combine them into &lt;em&gt;16-bit&lt;&#x2F;em&gt; values. This initially was very confusing to me, as all one can do with one byte is address 256 memory locations.&lt;&#x2F;p&gt;
&lt;h3 id=&quot;registers&quot;&gt;Registers&lt;a class=&quot;post-anchor&quot; href=&quot;#registers&quot; aria-label=&quot;Anchor link for: registers&quot;&gt;&lt;span aria-hidden=&quot;true&quot;&gt;#&lt;&#x2F;span&gt;&lt;&#x2F;a&gt;
&lt;&#x2F;h3&gt;
&lt;p&gt;Oh boy, there are almost none and using them has quite the learning curve:&lt;&#x2F;p&gt;
&lt;ul&gt;
&lt;li&gt;&lt;code&gt;ACC&lt;&#x2F;code&gt; the accumulator. Used for arithmetic mostly. Typically I keep the variable I&#x27;m currently working on in it&lt;&#x2F;li&gt;
&lt;li&gt;&lt;code&gt;X&lt;&#x2F;code&gt; general purpose register&lt;&#x2F;li&gt;
&lt;li&gt;&lt;code&gt;Y&lt;&#x2F;code&gt; general purpose register&lt;&#x2F;li&gt;
&lt;li&gt;There is also a flags register, which is used for control flow and set automatically inside arithmetic instructions and memory loads&lt;&#x2F;li&gt;
&lt;&#x2F;ul&gt;
&lt;p&gt;The biggest footguns are instructions that work with one of the registers, but not with another. So f.e. even though most arithmetic only works on the accumulator, there are opcodes for increasing the &lt;code&gt;X&lt;&#x2F;code&gt; and &lt;code&gt;Y&lt;&#x2F;code&gt; registers (&lt;code&gt;INX&lt;&#x2F;code&gt; and &lt;code&gt;INY&lt;&#x2F;code&gt;), but no &lt;code&gt;INA&lt;&#x2F;code&gt;. Another thing that was super annoying is even though &lt;code&gt;X&lt;&#x2F;code&gt; and &lt;code&gt;Y&lt;&#x2F;code&gt; are both kind of general purpose, they are used slightly different when indexing into memory, so f.e. there is &lt;code&gt;LDA (indirect,X)&lt;&#x2F;code&gt; and &lt;code&gt;LDA (indirect),Y&lt;&#x2F;code&gt; which both do something &lt;strong&gt;very&lt;&#x2F;strong&gt; different, so one must keep that in mind when deciding on which registers to use for what.&lt;&#x2F;p&gt;
&lt;h3 id=&quot;memory-layout&quot;&gt;Memory Layout&lt;a class=&quot;post-anchor&quot; href=&quot;#memory-layout&quot; aria-label=&quot;Anchor link for: memory-layout&quot;&gt;&lt;span aria-hidden=&quot;true&quot;&gt;#&lt;&#x2F;span&gt;&lt;&#x2F;a&gt;
&lt;&#x2F;h3&gt;
&lt;p&gt;The &lt;code&gt;6502&lt;&#x2F;code&gt; has a &lt;em&gt;16-bit&lt;&#x2F;em&gt; adressable memory space, which equates to 65.536 (2^16) bytes of memory. The architecture does not discern between code and &lt;code&gt;RAM&lt;&#x2F;code&gt;, and everything can live everywhere in the whole address space. In practice you need to be careful though to never overlap, as general memory typically does not equate to valid opcodes.&lt;&#x2F;p&gt;
&lt;p&gt;There are a few special memory locations reserved for internal functionality of the chip:&lt;&#x2F;p&gt;
&lt;ul&gt;
&lt;li&gt;0x0000 - 0x00ff -&amp;gt; Zero page. We are free to write whatever there, but it is used for special &lt;em&gt;addressing modes&lt;&#x2F;em&gt; we will need&lt;&#x2F;li&gt;
&lt;li&gt;0x0100 - 0x01ff -&amp;gt; Are reserved for the stack and subroutine stack&lt;&#x2F;li&gt;
&lt;li&gt;0xfffa - 0xffff -&amp;gt; Reserved for reset and interrup signals&lt;&#x2F;li&gt;
&lt;&#x2F;ul&gt;
&lt;p&gt;In general, the memory is split into 256 pages, which each are 256 bytes wide. Some of the instructions take more cpu cycles when they have to cross a page boundary.&lt;&#x2F;p&gt;
&lt;h3 id=&quot;zero-page&quot;&gt;Zero Page&lt;a class=&quot;post-anchor&quot; href=&quot;#zero-page&quot; aria-label=&quot;Anchor link for: zero-page&quot;&gt;&lt;span aria-hidden=&quot;true&quot;&gt;#&lt;&#x2F;span&gt;&lt;&#x2F;a&gt;
&lt;&#x2F;h3&gt;
&lt;p&gt;The very first memory page from 0x0000 to 0x00ff is special in many ways:&lt;&#x2F;p&gt;
&lt;ul&gt;
&lt;li&gt;A lot of opcodes have a special addressing mode for the 0 page&lt;&#x2F;li&gt;
&lt;li&gt;There is &lt;em&gt;indirect&lt;&#x2F;em&gt; memory adressing, where we store a pointer to a memory address at the zero page. Without that there is no way to address the other memory pages&lt;&#x2F;li&gt;
&lt;li&gt;Generally all opcodes are fastest (least amount of cycles) when they are executed in ther &lt;em&gt;zero-page-variant&lt;&#x2F;em&gt;&lt;&#x2F;li&gt;
&lt;&#x2F;ul&gt;
&lt;section class=&quot;alert tip&quot; role=&quot;note&quot; aria-labelledby=&quot;A6TZAmaA&quot;&gt;
    &lt;div class=&quot;alert-icon alert-icon-tip&quot;&gt;&lt;&#x2F;div&gt;
    &lt;div class=&quot;alert-content&quot; role=&quot;presentation&quot;&gt;
        &lt;strong id=&quot;A6TZAmaA&quot; class=&quot;alert-title&quot; aria-hidden=&quot;true&quot;&gt;rule of thumb&lt;&#x2F;strong&gt;
        &lt;p&gt;If we can do it in the zero page, we should&lt;&#x2F;p&gt;

    &lt;&#x2F;div&gt;
&lt;&#x2F;section&gt;
&lt;h3 id=&quot;opcodes&quot;&gt;Opcodes&lt;a class=&quot;post-anchor&quot; href=&quot;#opcodes&quot; aria-label=&quot;Anchor link for: opcodes&quot;&gt;&lt;span aria-hidden=&quot;true&quot;&gt;#&lt;&#x2F;span&gt;&lt;&#x2F;a&gt;
&lt;&#x2F;h3&gt;
&lt;p&gt;I&#x27;ll focus on the opcodes I used most frequently here, for a complete overview, see the amazing resource at &lt;a href=&quot;https:&#x2F;&#x2F;www.masswerk.at&#x2F;6502&#x2F;6502_instruction_set.html&quot;&gt;masswerk.at&lt;&#x2F;a&gt;.&lt;&#x2F;p&gt;
&lt;p&gt;Also in the next post, I&#x27;ll explain the opcodes that I&#x27;m using in details as I go along with the solution to day 1&lt;&#x2F;p&gt;
&lt;h4 id=&quot;memory-io&quot;&gt;Memory IO&lt;a class=&quot;post-anchor&quot; href=&quot;#memory-io&quot; aria-label=&quot;Anchor link for: memory-io&quot;&gt;&lt;span aria-hidden=&quot;true&quot;&gt;#&lt;&#x2F;span&gt;&lt;&#x2F;a&gt;
&lt;&#x2F;h4&gt;
&lt;ul&gt;
&lt;li&gt;&lt;code&gt;LDA&lt;&#x2F;code&gt;, &lt;code&gt;LDX&lt;&#x2F;code&gt;, &lt;code&gt;LDY&lt;&#x2F;code&gt; -&amp;gt; load a value into a register. Either from memory, or an &lt;em&gt;immediate value&lt;&#x2F;em&gt; f.e. &lt;code&gt;LDA #1&lt;&#x2F;code&gt; loads &lt;code&gt;1&lt;&#x2F;code&gt; into the accumulator&lt;&#x2F;li&gt;
&lt;li&gt;&lt;code&gt;STA&lt;&#x2F;code&gt;, &lt;code&gt;STX&lt;&#x2F;code&gt;, &lt;code&gt;STY&lt;&#x2F;code&gt; -&amp;gt; store the value currently in the register into a given memory address.&lt;&#x2F;li&gt;
&lt;li&gt;&lt;code&gt;INC&lt;&#x2F;code&gt; -&amp;gt; increase the value in a given memory location by 1&lt;&#x2F;li&gt;
&lt;&#x2F;ul&gt;
&lt;h4 id=&quot;register-manipulation&quot;&gt;Register manipulation&lt;a class=&quot;post-anchor&quot; href=&quot;#register-manipulation&quot; aria-label=&quot;Anchor link for: register-manipulation&quot;&gt;&lt;span aria-hidden=&quot;true&quot;&gt;#&lt;&#x2F;span&gt;&lt;&#x2F;a&gt;
&lt;&#x2F;h4&gt;
&lt;ul&gt;
&lt;li&gt;&lt;code&gt;TAY&lt;&#x2F;code&gt;, &lt;code&gt;TAX&lt;&#x2F;code&gt; -&amp;gt; Transfer (copy) the value in the accumulator to register &lt;code&gt;X&lt;&#x2F;code&gt; or &lt;code&gt;Y&lt;&#x2F;code&gt;&lt;&#x2F;li&gt;
&lt;li&gt;&lt;code&gt;TXA&lt;&#x2F;code&gt;, &lt;code&gt;TYA&lt;&#x2F;code&gt; -&amp;gt; Transfer (copy) the value in the register to the accumulator&lt;&#x2F;li&gt;
&lt;li&gt;&lt;code&gt;INX&lt;&#x2F;code&gt;, &lt;code&gt;INY&lt;&#x2F;code&gt; -&amp;gt; Increase the value in the register by 1. There is no variant for the accumulator&lt;&#x2F;li&gt;
&lt;&#x2F;ul&gt;
&lt;h4 id=&quot;control-flow&quot;&gt;Control flow&lt;a class=&quot;post-anchor&quot; href=&quot;#control-flow&quot; aria-label=&quot;Anchor link for: control-flow&quot;&gt;&lt;span aria-hidden=&quot;true&quot;&gt;#&lt;&#x2F;span&gt;&lt;&#x2F;a&gt;
&lt;&#x2F;h4&gt;
&lt;img src=&quot;https:&#x2F;&#x2F;lando.codeberg.page&#x2F;processed_images&#x2F;always_has_been.3d790b87216c1e79.jpg&quot; alt=&quot;GOTO all the way down&quot;
     width=&quot;888&quot; height=&quot;499&quot;
     sizes=&quot;(min-width: 920px) 784px, (min-width: 700px) calc(82vw + 46px), calc(100vw - 40px)&quot; 
     srcset=&quot;https:&#x2F;&#x2F;lando.codeberg.page&#x2F;processed_images&#x2F;always_has_been.c4454ec8899b6169.jpg 640w,
             https:&#x2F;&#x2F;lando.codeberg.page&#x2F;processed_images&#x2F;always_has_been.71509be2c139c92a.jpg 784w&quot;
     loading=&quot;lazy&quot;&gt;
&lt;p&gt;Yeah so control flow is just &lt;code&gt;GOTO&lt;&#x2F;code&gt; with a slight variant of using &lt;em&gt;subroutines&lt;&#x2F;em&gt; via &lt;code&gt;JSR&lt;&#x2F;code&gt; (JumpSubRoutine) and &lt;code&gt;RTS&lt;&#x2F;code&gt;(ReTurnfromSubroutine). Structuring programs and following the flow was very hard for me in the beginning with only this construct.&lt;&#x2F;p&gt;
&lt;ul&gt;
&lt;li&gt;&lt;code&gt;JMP&lt;&#x2F;code&gt; -&amp;gt; Jump to another instruction by literally setting the program counter there&lt;&#x2F;li&gt;
&lt;li&gt;&lt;code&gt;BEQ&lt;&#x2F;code&gt;, &lt;code&gt;BNE&lt;&#x2F;code&gt;, &lt;code&gt;BMI&lt;&#x2F;code&gt;, &lt;code&gt;BPL&lt;&#x2F;code&gt; -&amp;gt; Break on a condition and do a jump to the memory address. Conditions are equal, not equal, negative, positive (in order)&lt;&#x2F;li&gt;
&lt;li&gt;&lt;code&gt;JSR&lt;&#x2F;code&gt;, &lt;code&gt;RTS&lt;&#x2F;code&gt; -&amp;gt; Jump into and return from subroutines. Somewhat similar to functions in &lt;em&gt;high-level&lt;&#x2F;em&gt; languages&lt;&#x2F;li&gt;
&lt;li&gt;&lt;code&gt;BRK&lt;&#x2F;code&gt; -&amp;gt; Kill the whole program (but keeping memory and registers intact). I use that to signal that the program is done&lt;&#x2F;li&gt;
&lt;&#x2F;ul&gt;
&lt;h2 id=&quot;day-1&quot;&gt;Day 1&lt;a class=&quot;post-anchor&quot; href=&quot;#day-1&quot; aria-label=&quot;Anchor link for: day-1&quot;&gt;&lt;span aria-hidden=&quot;true&quot;&gt;#&lt;&#x2F;span&gt;&lt;&#x2F;a&gt;
&lt;&#x2F;h2&gt;
&lt;p&gt;I&#x27;ll go over my solution to day 1 in &lt;a href=&quot;https:&#x2F;&#x2F;lando.codeberg.page&#x2F;blog&#x2F;aocd1&#x2F;&quot;&gt;the next post&lt;&#x2F;a&gt;, to keep this one focused on the general setup and information about the technology itself.&lt;&#x2F;p&gt;
</description>
      </item>
      <item>
          <title>Setting up my blog</title>
          <pubDate>Tue, 13 Jan 2026 00:00:00 +0000</pubDate>
          <author>Lando Schumpich</author>
          <link>https://lando.codeberg.page/blog/blogging-again/</link>
          <guid>https://lando.codeberg.page/blog/blogging-again/</guid>
          <description xml:base="https://lando.codeberg.page/blog/blogging-again/">&lt;h2 id=&quot;introduction&quot;&gt;Introduction&lt;a class=&quot;post-anchor&quot; href=&quot;#introduction&quot; aria-label=&quot;Anchor link for: introduction&quot;&gt;&lt;span aria-hidden=&quot;true&quot;&gt;#&lt;&#x2F;span&gt;&lt;&#x2F;a&gt;
&lt;&#x2F;h2&gt;
&lt;p&gt;After I killed my personal website somewhere around 2023, since I never really found time to update it anymore, I have been missing a place to give as a home to my loose thoughts. Consider this blog that place and I hope I will keep writing here in the future.&lt;&#x2F;p&gt;
&lt;h2 id=&quot;research&quot;&gt;Research&lt;a class=&quot;post-anchor&quot; href=&quot;#research&quot; aria-label=&quot;Anchor link for: research&quot;&gt;&lt;span aria-hidden=&quot;true&quot;&gt;#&lt;&#x2F;span&gt;&lt;&#x2F;a&gt;
&lt;&#x2F;h2&gt;
&lt;p&gt;I took some time looking for a good solution for my new personal site, focused on &lt;strong&gt;blogging&lt;&#x2F;strong&gt; and &lt;strong&gt;ease-of-hosting&lt;&#x2F;strong&gt;. My priorities where roughly:&lt;&#x2F;p&gt;
&lt;ul&gt;
&lt;li&gt;Should generate a static site&lt;&#x2F;li&gt;
&lt;li&gt;Should be easy to set up&lt;&#x2F;li&gt;
&lt;li&gt;Should be maintained, or at least reasonably popular&lt;&#x2F;li&gt;
&lt;li&gt;Should have a focus on blogging &#x2F; personal sites&lt;&#x2F;li&gt;
&lt;li&gt;Should have good enough themes &lt;em&gt;out-of-the-box&lt;&#x2F;em&gt; so I don&#x27;t get distracted theming the site immediately&lt;&#x2F;li&gt;
&lt;li&gt;Should have support for &lt;em&gt;atom&lt;&#x2F;em&gt; &#x2F; &lt;em&gt;rss&lt;&#x2F;em&gt; feed generation from my posts&lt;&#x2F;li&gt;
&lt;&#x2F;ul&gt;
&lt;p&gt;A very good site I found when searching was &lt;a href=&quot;https:&#x2F;&#x2F;jamstack.org&#x2F;generators&#x2F;&quot;&gt;Jamstack&lt;&#x2F;a&gt; and after looking through many different generators I finally landed on &lt;a href=&quot;https:&#x2F;&#x2F;www.getzola.org&#x2F;&quot;&gt;Zola&lt;&#x2F;a&gt;&lt;&#x2F;p&gt;
&lt;h2 id=&quot;setting-up-zola&quot;&gt;Setting up Zola&lt;a class=&quot;post-anchor&quot; href=&quot;#setting-up-zola&quot; aria-label=&quot;Anchor link for: setting-up-zola&quot;&gt;&lt;span aria-hidden=&quot;true&quot;&gt;#&lt;&#x2F;span&gt;&lt;&#x2F;a&gt;
&lt;&#x2F;h2&gt;
&lt;p&gt;Getting started with Zola was both easy and a bit confusing:&lt;&#x2F;p&gt;
&lt;ul&gt;
&lt;li&gt;Installing and getting it running is super easy&lt;&#x2F;li&gt;
&lt;li&gt;Theming the size is very confusing, as you don&#x27;t just apply a theme, but also get new content templates you have to adhere to. At least I found it to not work with the templates from the blog example from the zola documentation&lt;&#x2F;li&gt;
&lt;&#x2F;ul&gt;
&lt;p&gt;I installed the first minimal theme focused on blogging that I liked &lt;a href=&quot;https:&#x2F;&#x2F;github.com&#x2F;ebkalderon&#x2F;terminus&quot;&gt;terminus&lt;&#x2F;a&gt;&lt;&#x2F;p&gt;
&lt;h3 id=&quot;installation&quot;&gt;Installation&lt;a class=&quot;post-anchor&quot; href=&quot;#installation&quot; aria-label=&quot;Anchor link for: installation&quot;&gt;&lt;span aria-hidden=&quot;true&quot;&gt;#&lt;&#x2F;span&gt;&lt;&#x2F;a&gt;
&lt;&#x2F;h3&gt;
&lt;p&gt;I&#x27;m sadly still on windows, but at least installing zola there is as easy as it gets using &lt;code&gt;winget&lt;&#x2F;code&gt;&lt;&#x2F;p&gt;
&lt;pre data-lang=&quot;powershell&quot; style=&quot;background-color:#272822;color:#f8f8f2;&quot; class=&quot;language-powershell &quot;&gt;&lt;code class=&quot;language-powershell&quot; data-lang=&quot;powershell&quot;&gt;&lt;span&gt;winget install getzola.zola
&lt;&#x2F;span&gt;&lt;&#x2F;code&gt;&lt;&#x2F;pre&gt;
&lt;p&gt;And that&#x27;s all, now we are ready to create a new site by running &lt;code&gt;zola init&lt;&#x2F;code&gt; inside of an empty folder&lt;&#x2F;p&gt;
&lt;h3 id=&quot;choosing-a-theme&quot;&gt;Choosing a theme&lt;a class=&quot;post-anchor&quot; href=&quot;#choosing-a-theme&quot; aria-label=&quot;Anchor link for: choosing-a-theme&quot;&gt;&lt;span aria-hidden=&quot;true&quot;&gt;#&lt;&#x2F;span&gt;&lt;&#x2F;a&gt;
&lt;&#x2F;h3&gt;
&lt;p&gt;The official docs are a &lt;strong&gt;trap&lt;&#x2F;strong&gt;, since they will have you set up your own templates for blogging. This works fine as a first test, but when you then use a theme, it will not work, as those come with their own templates.&lt;&#x2F;p&gt;
&lt;p&gt;So rather choose a theme right away, install it depending to it&#x27;s documentation and look how they have setup their templates.&lt;&#x2F;p&gt;
&lt;p&gt;For &lt;code&gt;terminus&lt;&#x2F;code&gt; &lt;em&gt;(and I think most other themes)&lt;&#x2F;em&gt; the best way to install is to clone a &lt;code&gt;git submodule&lt;&#x2F;code&gt; into the &lt;code&gt;themes&lt;&#x2F;code&gt; folder.&lt;&#x2F;p&gt;
&lt;pre data-lang=&quot;sh&quot; style=&quot;background-color:#272822;color:#f8f8f2;&quot; class=&quot;language-sh &quot;&gt;&lt;code class=&quot;language-sh&quot; data-lang=&quot;sh&quot;&gt;&lt;span&gt;git submodule add https:&#x2F;&#x2F;github.com&#x2F;ebkalderon&#x2F;terminus.git themes&#x2F;terminus
&lt;&#x2F;span&gt;&lt;&#x2F;code&gt;&lt;&#x2F;pre&gt;
&lt;h2 id=&quot;next-steps&quot;&gt;Next steps&lt;a class=&quot;post-anchor&quot; href=&quot;#next-steps&quot; aria-label=&quot;Anchor link for: next-steps&quot;&gt;&lt;span aria-hidden=&quot;true&quot;&gt;#&lt;&#x2F;span&gt;&lt;&#x2F;a&gt;
&lt;&#x2F;h2&gt;
&lt;p&gt;Other than filling up the site with some posts, I also want to look into other things:&lt;&#x2F;p&gt;
&lt;ul&gt;
&lt;li&gt;Structuring blog posts into long-form projects for themes I&#x27;m interested in, or open-source code I&#x27;ll be writing over long time periods&lt;&#x2F;li&gt;
&lt;li&gt;Actually hosting the site, either on &lt;a href=&quot;https:&#x2F;&#x2F;docs.codeberg.org&#x2F;codeberg-pages&#x2F;&quot;&gt;Codeberg pages&lt;&#x2F;a&gt;, or some cheap hosting service&lt;&#x2F;li&gt;
&lt;li&gt;Venture into self-hosting and write about that&lt;&#x2F;li&gt;
&lt;&#x2F;ul&gt;
</description>
      </item>
    </channel>
</rss>
