<?xml version="1.0" encoding="utf-8" standalone="yes"?><rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom"><channel><title>Prerequisite Knowledge on Programming the Atari VCS in Assembly</title><link>https://cdeever.github.io/atari-vcs/docs/prerequisites/</link><description>Recent content in Prerequisite Knowledge on Programming the Atari VCS in Assembly</description><generator>Hugo</generator><language>en-us</language><atom:link href="https://cdeever.github.io/atari-vcs/docs/prerequisites/index.xml" rel="self" type="application/rss+xml"/><item><title>How a Television Works</title><link>https://cdeever.github.io/atari-vcs/docs/prerequisites/how-the-tv-works/</link><pubDate>Mon, 01 Jan 0001 00:00:00 +0000</pubDate><guid>https://cdeever.github.io/atari-vcs/docs/prerequisites/how-the-tv-works/</guid><description>&lt;h1 id="how-a-television-works"&gt;How a Television Works&lt;a class="anchor" href="#how-a-television-works"&gt;#&lt;/a&gt;&lt;/h1&gt;
&lt;p&gt;Before the VCS makes sense, the &lt;em&gt;television&lt;/em&gt; has to. Every concept in this book — the frame loop, sync signals, &amp;ldquo;Racing the Beam,&amp;rdquo; the cycle budget — is a direct consequence of how a cathode-ray-tube TV paints a picture. You don&amp;rsquo;t need a broadcast-engineering course; you need the handful of facts the hardware forces you to care about.&lt;/p&gt;
&lt;h2 id="the-beam-paints-one-line-at-a-time"&gt;The beam paints one line at a time&lt;a class="anchor" href="#the-beam-paints-one-line-at-a-time"&gt;#&lt;/a&gt;&lt;/h2&gt;
&lt;p&gt;A CRT television draws its image with a single &lt;strong&gt;electron beam&lt;/strong&gt; that sweeps across the screen from behind. It moves in a fixed pattern:&lt;/p&gt;</description></item><item><title>Reading 6502 Assembly</title><link>https://cdeever.github.io/atari-vcs/docs/prerequisites/reading-assembly/</link><pubDate>Mon, 01 Jan 0001 00:00:00 +0000</pubDate><guid>https://cdeever.github.io/atari-vcs/docs/prerequisites/reading-assembly/</guid><description>&lt;h1 id="reading-6502-assembly"&gt;Reading 6502 Assembly&lt;a class="anchor" href="#reading-6502-assembly"&gt;#&lt;/a&gt;&lt;/h1&gt;
&lt;p&gt;Every line of code in this book is &lt;strong&gt;6502 assembly language&lt;/strong&gt; — human-readable names for the numeric machine code the 6507 actually executes. &lt;a href="https://cdeever.github.io/atari-vcs/docs/getting-started/toolchain/"&gt;DASM&lt;/a&gt; translates it into the bytes that go on the cartridge. You don&amp;rsquo;t need to &lt;em&gt;write&lt;/em&gt; it fluently yet, but you do need to &lt;em&gt;read&lt;/em&gt; it, because every concept here is demonstrated in it. This page is just enough to follow along; the CPU&amp;rsquo;s full instruction set and addressing modes are the &lt;a href="https://cdeever.github.io/atari-vcs/docs/6502-basics/"&gt;6502 Basics&lt;/a&gt; chapter.&lt;/p&gt;</description></item><item><title>Thinking in Bits</title><link>https://cdeever.github.io/atari-vcs/docs/prerequisites/bits/</link><pubDate>Mon, 01 Jan 0001 00:00:00 +0000</pubDate><guid>https://cdeever.github.io/atari-vcs/docs/prerequisites/bits/</guid><description>&lt;h1 id="thinking-in-bits"&gt;Thinking in Bits&lt;a class="anchor" href="#thinking-in-bits"&gt;#&lt;/a&gt;&lt;/h1&gt;
&lt;p&gt;On the VCS, almost every hardware register is a bag of individual switches — one bit turns on playfield reflection, one bit is the fire button, a group of bits picks a sound waveform. There is no high-level API; you set and clear bits directly. This page is the bit literacy the rest of the book assumes. Its companion, &lt;a href="https://cdeever.github.io/atari-vcs/docs/prerequisites/memory-mapped/"&gt;The Memory-Mapped Interface&lt;/a&gt;, covers &lt;em&gt;where&lt;/em&gt; those bits live and how you reach them.&lt;/p&gt;</description></item><item><title>Numbers &amp; Arithmetic</title><link>https://cdeever.github.io/atari-vcs/docs/prerequisites/numbers/</link><pubDate>Mon, 01 Jan 0001 00:00:00 +0000</pubDate><guid>https://cdeever.github.io/atari-vcs/docs/prerequisites/numbers/</guid><description>&lt;h1 id="numbers--arithmetic"&gt;Numbers &amp;amp; Arithmetic&lt;a class="anchor" href="#numbers--arithmetic"&gt;#&lt;/a&gt;&lt;/h1&gt;
&lt;p&gt;&lt;a href="https://cdeever.github.io/atari-vcs/docs/prerequisites/bits/"&gt;Thinking in Bits&lt;/a&gt; covered a byte as a pattern of switches. This page is about a byte as a &lt;em&gt;number&lt;/em&gt; — and the surprising limits of doing math on a 1977 processor. The big ones: there are only 256 possible values, negative numbers are a convention rather than a feature, and &lt;strong&gt;the 6502 cannot multiply or divide at all.&lt;/strong&gt;&lt;/p&gt;
&lt;h2 id="a-byte-is-0255--or-128-to-127"&gt;A byte is 0–255 — or −128 to 127&lt;a class="anchor" href="#a-byte-is-0255--or-128-to-127"&gt;#&lt;/a&gt;&lt;/h2&gt;
&lt;p&gt;An 8-bit byte holds 256 distinct values. Read as &lt;strong&gt;unsigned&lt;/strong&gt;, that&amp;rsquo;s 0 to 255. But the CPU has no separate &amp;ldquo;signed&amp;rdquo; type; instead, by convention, the &lt;strong&gt;top bit is treated as a sign&lt;/strong&gt; using &lt;strong&gt;two&amp;rsquo;s complement&lt;/strong&gt;:&lt;/p&gt;</description></item><item><title>The Memory-Mapped Interface</title><link>https://cdeever.github.io/atari-vcs/docs/prerequisites/memory-mapped/</link><pubDate>Mon, 01 Jan 0001 00:00:00 +0000</pubDate><guid>https://cdeever.github.io/atari-vcs/docs/prerequisites/memory-mapped/</guid><description>&lt;h1 id="the-memory-mapped-interface"&gt;The Memory-Mapped Interface&lt;a class="anchor" href="#the-memory-mapped-interface"&gt;#&lt;/a&gt;&lt;/h1&gt;
&lt;p&gt;On the VCS you talk to hardware by reading and writing memory addresses. The chips that make sound, draw pixels, and read the joystick live &lt;em&gt;in the same address space as RAM&lt;/em&gt;, so a &lt;code&gt;sta&lt;/code&gt; to the right address isn&amp;rsquo;t storing data — it&amp;rsquo;s operating a chip. This page assumes the bit literacy from &lt;a href="https://cdeever.github.io/atari-vcs/docs/prerequisites/bits/"&gt;Thinking in Bits&lt;/a&gt;; here we cover &lt;em&gt;where&lt;/em&gt; those bits go.&lt;/p&gt;
&lt;h2 id="registers-are-just-addresses"&gt;Registers are just addresses&lt;a class="anchor" href="#registers-are-just-addresses"&gt;#&lt;/a&gt;&lt;/h2&gt;
&lt;p&gt;The 6502/6507 has exactly one kind of &amp;ldquo;talk to the outside world&amp;rdquo; instruction — the same loads and stores it uses for RAM. There is &lt;strong&gt;no separate I/O instruction&lt;/strong&gt;. Instead, the TIA (graphics/sound), the RIOT (RAM, timer, and joystick/switch ports), and the cartridge ROM are all wired to &lt;em&gt;respond to specific addresses&lt;/em&gt;. This is &lt;strong&gt;memory-mapped I/O&lt;/strong&gt;: the chip behind an address decides what reading or writing it actually does.&lt;/p&gt;</description></item></channel></rss>