<?xml version="1.0" encoding="UTF-8"?><rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>6502 | Learn C Games Programming Blog</title>
	<atom:link href="https://learncgames.com/tag/6502/feed/" rel="self" type="application/rss+xml" />
	<link>https://learncgames.com</link>
	<description>A blog about C, programming games and my ebook(s).</description>
	<lastBuildDate>Sat, 18 Jul 2020 09:27:40 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>
	hourly	</sy:updatePeriod>
	<sy:updateFrequency>
	1	</sy:updateFrequency>
	<generator>https://wordpress.org/?v=6.9.4</generator>

<image>
	<url>https://learncgames.com/wp-content/uploads/2020/03/cropped-favicon-32x32.png</url>
	<title>6502 | Learn C Games Programming Blog</title>
	<link>https://learncgames.com</link>
	<width>32</width>
	<height>32</height>
</image> 
<site xmlns="com-wordpress:feed-additions:1">181446779</site>	<item>
		<title>Who needs asm? cc65 C compiler</title>
		<link>https://learncgames.com/who-needs-asm-cc65-c-compiler/?utm_source=rss&#038;utm_medium=rss&#038;utm_campaign=who-needs-asm-cc65-c-compiler</link>
		
		<dc:creator><![CDATA[David]]></dc:creator>
		<pubDate>Fri, 17 Jul 2020 23:00:49 +0000</pubDate>
				<category><![CDATA[C]]></category>
		<category><![CDATA[6502]]></category>
		<category><![CDATA[compiler]]></category>
		<guid isPermaLink="false">https://learncgames.com/?p=998</guid>

					<description><![CDATA[<p>Back in the day 1984-1989, I wrote games in Z80 and 6502 assembly. It would be another 10 years before I learnt C++ and ten years after that for C. But I would have killed to have had a C compiler that generated 6502 code back then. Writing assembly language code is slow and painstaking. [&#8230;]</p>
The post <a href="https://learncgames.com/who-needs-asm-cc65-c-compiler/">Who needs asm? cc65 C compiler</a> first appeared on <a href="https://learncgames.com">Learn C Games Programming Blog</a>.]]></description>
										<content:encoded><![CDATA[<div class='__iawmlf-post-loop-links' style='display:none;' data-iawmlf-post-links='[{&quot;id&quot;:620,&quot;href&quot;:&quot;https:\/\/pixabay.com\/users\/OpenClipart-Vectors-30363\/?utm_source=link-attribution&amp;utm_medium=referral&amp;utm_campaign=image&amp;utm_content=160186&quot;,&quot;archived_href&quot;:&quot;http:\/\/web-wp.archive.org\/web\/20251230124419\/https:\/\/pixabay.com\/users\/openclipart-vectors-30363\/?utm_source=link-attribution&quot;,&quot;redirect_href&quot;:&quot;&quot;,&quot;checks&quot;:[{&quot;date&quot;:&quot;2026-02-06 16:49:38&quot;,&quot;http_code&quot;:403},{&quot;date&quot;:&quot;2026-02-18 04:42:41&quot;,&quot;http_code&quot;:403},{&quot;date&quot;:&quot;2026-03-15 19:23:34&quot;,&quot;http_code&quot;:403},{&quot;date&quot;:&quot;2026-03-29 15:11:56&quot;,&quot;http_code&quot;:403},{&quot;date&quot;:&quot;2026-04-03 09:16:29&quot;,&quot;http_code&quot;:403},{&quot;date&quot;:&quot;2026-04-07 16:20:38&quot;,&quot;http_code&quot;:403},{&quot;date&quot;:&quot;2026-04-30 09:36:22&quot;,&quot;http_code&quot;:403}],&quot;broken&quot;:true,&quot;last_checked&quot;:{&quot;date&quot;:&quot;2026-04-30 09:36:22&quot;,&quot;http_code&quot;:403},&quot;process&quot;:&quot;done&quot;},{&quot;id&quot;:621,&quot;href&quot;:&quot;https:\/\/pixabay.com\/?utm_source=link-attribution&amp;utm_medium=referral&amp;utm_campaign=image&amp;utm_content=160186&quot;,&quot;archived_href&quot;:&quot;http:\/\/web-wp.archive.org\/web\/20260205102120\/https:\/\/pixabay.com\/?utm_source=link-attribution&quot;,&quot;redirect_href&quot;:&quot;&quot;,&quot;checks&quot;:[{&quot;date&quot;:&quot;2026-02-06 16:49:43&quot;,&quot;http_code&quot;:403},{&quot;date&quot;:&quot;2026-02-18 04:42:41&quot;,&quot;http_code&quot;:403},{&quot;date&quot;:&quot;2026-03-15 19:23:34&quot;,&quot;http_code&quot;:403},{&quot;date&quot;:&quot;2026-03-29 15:11:56&quot;,&quot;http_code&quot;:403},{&quot;date&quot;:&quot;2026-04-03 09:16:27&quot;,&quot;http_code&quot;:403},{&quot;date&quot;:&quot;2026-04-07 16:20:39&quot;,&quot;http_code&quot;:403},{&quot;date&quot;:&quot;2026-04-30 09:36:22&quot;,&quot;http_code&quot;:403}],&quot;broken&quot;:true,&quot;last_checked&quot;:{&quot;date&quot;:&quot;2026-04-30 09:36:22&quot;,&quot;http_code&quot;:403},&quot;process&quot;:&quot;done&quot;},{&quot;id&quot;:622,&quot;href&quot;:&quot;https:\/\/cc65.github.io&quot;,&quot;archived_href&quot;:&quot;http:\/\/web-wp.archive.org\/web\/20260106152809\/https:\/\/cc65.github.io\/&quot;,&quot;redirect_href&quot;:&quot;&quot;,&quot;checks&quot;:[{&quot;date&quot;:&quot;2026-02-06 16:49:44&quot;,&quot;http_code&quot;:206},{&quot;date&quot;:&quot;2026-02-17 13:54:06&quot;,&quot;http_code&quot;:206},{&quot;date&quot;:&quot;2026-02-22 05:50:38&quot;,&quot;http_code&quot;:206},{&quot;date&quot;:&quot;2026-02-27 12:29:56&quot;,&quot;http_code&quot;:206},{&quot;date&quot;:&quot;2026-03-04 18:50:31&quot;,&quot;http_code&quot;:206},{&quot;date&quot;:&quot;2026-03-08 05:20:26&quot;,&quot;http_code&quot;:206},{&quot;date&quot;:&quot;2026-03-29 15:11:57&quot;,&quot;http_code&quot;:206},{&quot;date&quot;:&quot;2026-04-02 09:11:28&quot;,&quot;http_code&quot;:206},{&quot;date&quot;:&quot;2026-04-05 11:19:18&quot;,&quot;http_code&quot;:206},{&quot;date&quot;:&quot;2026-04-13 20:30:17&quot;,&quot;http_code&quot;:206},{&quot;date&quot;:&quot;2026-04-17 17:47:26&quot;,&quot;http_code&quot;:206},{&quot;date&quot;:&quot;2026-04-30 09:36:23&quot;,&quot;http_code&quot;:206}],&quot;broken&quot;:false,&quot;last_checked&quot;:{&quot;date&quot;:&quot;2026-04-30 09:36:23&quot;,&quot;http_code&quot;:206},&quot;process&quot;:&quot;done&quot;}]'></div>
<figure id="attachment_999" aria-describedby="caption-attachment-999" style="width: 300px" class="wp-caption alignleft"><img decoding="async" class="size-medium wp-image-999" src="https://learncgames.com/wp-content/uploads/2020/07/commodore-160186_640-300x150.png" alt="Commodore Computer" width="300" height="150" srcset="https://learncgames.com/wp-content/uploads/2020/07/commodore-160186_640-300x150.png 300w, https://learncgames.com/wp-content/uploads/2020/07/commodore-160186_640.png 640w" sizes="(max-width: 300px) 100vw, 300px" /><figcaption id="caption-attachment-999" class="wp-caption-text">Image by <a href="https://pixabay.com/users/OpenClipart-Vectors-30363/?utm_source=link-attribution&amp;utm_medium=referral&amp;utm_campaign=image&amp;utm_content=160186">OpenClipart-Vectors</a> from <a href="https://pixabay.com/?utm_source=link-attribution&amp;utm_medium=referral&amp;utm_campaign=image&amp;utm_content=160186">Pixabay</a></figcaption></figure>
<p>Back in the day 1984-1989, I wrote games in Z80 and 6502 assembly. It would be another 10 years before I learnt C++ and ten years after that for C. But I would have killed to have had a C compiler that generated 6502 code back then. Writing assembly language code is slow and painstaking. You have to remember whats in each register (A,X and Y) and what you are using page 0 locations for.</p>
<p>It takes the same length of time to write and debug 10 lines of 6502 assembler as it does to write 10 lines of C.  But those ten lines of C can do way more than 10 lines of 6502 assembly.</p>
<p>On a 6502 which is an 8 bit CPU with 16-bit addressing, memory goes from 0-65535. It takes two bytes for an address unless it is in the first 256 bytes (0-255) which only needs 1 byte. You can optimise your code by using page 0 for many variables. It only takes 2-byte instructions to fetch them from memory and write them back. The first byte is the instruction, the 2nd the address. Compare that with the rest of memory where instructions are three bytes long with 2-bytes for the address.</p>
<p><a title="Link to cc65" href="https://cc65.github.io/" target="_blank" rel="noopener noreferrer">CC65</a> is a C compiler that generates 6502 code. It&#8217;s mostly written in C. I&#8217;ve added a permanent link to it on the <a title="Link to C codes page" href="https://learncgames.com/c-code-links/" target="_blank" rel="noopener noreferrer">C Codes link</a> page. Pictured is a CBM-64 like the one I used to own.</p>The post <a href="https://learncgames.com/who-needs-asm-cc65-c-compiler/">Who needs asm? cc65 C compiler</a> first appeared on <a href="https://learncgames.com">Learn C Games Programming Blog</a>.]]></content:encoded>
					
		
		
		<post-id xmlns="com-wordpress:feed-additions:1">998</post-id>	</item>
	</channel>
</rss>
