<?xml version="1.0" encoding="UTF-8"?>
<!-- generator="todaycom/2.3.1" -->
<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/"
	>

<channel>
	<title>Programmer's Diary</title>
	<link>http://programmersdiary.today.com</link>
	<description>thoughts of an obsessive programmer</description>
	<pubDate>Tue, 17 Nov 2009 18:17:28 +0000</pubDate>
	<generator>http://www.today.com/version-2.3.1</generator>
	<language>en</language>
			<item>
		<title>Son of Darts Programming Contest</title>
		<link>http://programmersdiary.today.com/2009/11/17/son-of-darts-programming-contest-2/</link>
		<comments>http://programmersdiary.today.com/2009/11/17/son-of-darts-programming-contest-2/#comments</comments>
		<pubDate>Tue, 17 Nov 2009 17:46:59 +0000</pubDate>
		<dc:creator>impomatic</dc:creator>
		
		<category><![CDATA[Programming]]></category>

		<category><![CDATA[basic]]></category>

		<guid isPermaLink="false">http://programmersdiary.today.com/2009/11/17/son-of-darts-programming-contest-2/</guid>
		<description><![CDATA[I&#8217;m taking part in Al Zimmermann&#8217;s latest programming contest, Son of Darts. The idea of the contest is to select values for the regions on a dartboard. The aim is for a number of darts to make as many consecutive values as possible.
For example with 6 darts and two regions with values 1 and 5, [...]]]></description>
			<content:encoded><![CDATA[<p>I&#8217;m taking part in Al Zimmermann&#8217;s latest programming contest, <a href="http://www.azspcs.net/Contest/SonOfDarts">Son of Darts</a>. The idea of the contest is to select values for the regions on a dartboard. The aim is for a number of darts to make as many consecutive values as possible.</p>
<p>For example with 6 darts and two regions with values 1 and 5, it&#8217;s possible to make any value from 1 to 18, but not 19.</p>
<p>Being a lazy programmer, I&#8217;ve coded a dumb brute force attack rather than taking the time to come up with a fancy algorithm. So far I&#8217;ve found the optimal solution for 1 to 6 regions and I&#8217;m reached rank 130 in the standings!</p>
<p>Here&#8217;s the program I&#8217;m using, written in BASIC. Unfortunately it&#8217;s incredibly slow <img src='http://programmersdiary.today.com/wp-includes/images/smilies/icon_sad.gif' alt=':-(' class='wp-smiley' /> Can you see any obvious improvements?:</p>
<pre>10 regions=3
20 high=0
30 dim r(regions+1)
40 max=5000
50 dim s(max)

60 for a=1 to regions+1
70 r(a)=a-1
80 next a

90 for a=1 to max
100 s(a)=0
110 next a

120 for c=1 to regions+1
130 for d=c to regions+1
140 for e=d to regions+1
150 for f=e to regions+1
160 for g=f to regions+1
170 for h=g to regions+1
180 s(r(c)+r(d)+r(e)+r(f)+r(g)+r(h))=1
190 next h
200 next g
210 next f
220 next e
230 next d
240 next c

250 best=0
260 best=best+1
270 if s(best)=1 and best&lt;max then goto 260
280 if best&lt;high then goto 350

290 high=best
300 print best,
310 for a=2 to regions+1
320 print r(a);
330 next a
340 print

350 ptr=regions+1
360 r(ptr)=r(ptr)+1
370 if r(ptr)&gt;best then goto 390
380 if r(ptr)&lt;1000 then goto 90
390 r(ptr)=r(ptr-1)+2
400 ptr=ptr-1
410 if ptr&lt;&gt;2 then goto 360
420 stop
</pre>
]]></content:encoded>
			<wfw:commentRss>http://programmersdiary.today.com/2009/11/17/son-of-darts-programming-contest-2/feed/</wfw:commentRss>
		</item>
		<item>
		<title>Songs in Code</title>
		<link>http://programmersdiary.today.com/2009/09/26/songs-in-code/</link>
		<comments>http://programmersdiary.today.com/2009/09/26/songs-in-code/#comments</comments>
		<pubDate>Sat, 26 Sep 2009 06:06:19 +0000</pubDate>
		<dc:creator>impomatic</dc:creator>
		
		<category><![CDATA[Programming]]></category>

		<category><![CDATA[#songsincode]]></category>

		<category><![CDATA[music]]></category>

		<category><![CDATA[twitter]]></category>

		<guid isPermaLink="false">http://programmersdiary.today.com/2009/09/26/songs-in-code/</guid>
		<description><![CDATA[#songsincode is a trend which started on Twitter a few weeks ago. The idea is to express the title or lyrics of a song as a computer program. Here&#8217;s an example by Roy van Rijn:

for(Leaf leaf:leafs)
{leaf.setColor(new Color(139,69,19));}
sky.setColor(Color.GRAY);

This is California Dreamin&#8217; by the Mamas and Papas, &#8220;All the leaves are brown and the sky is gray&#8221;. [...]]]></description>
			<content:encoded><![CDATA[<p><strong>#songsincode</strong> is a trend which started on Twitter a few weeks ago. The idea is to express the title or lyrics of a song as a computer program. Here&#8217;s an example by Roy van Rijn:</p>
<ul>
<p><code>for(Leaf leaf:leafs)</code><br />
<code>{leaf.setColor(new Color(139,69,19));}</code><br />
<code>sky.setColor(Color.GRAY);</code></p>
</ul>
<p>This is California Dreamin&#8217; by the Mamas and Papas, &#8220;All the leaves are brown and the sky is gray&#8221;. If #songsincode is of interest, here are some of the best collections I&#8217;ve found:</p>
<ul>
<li><a href="http://retrocode.blogspot.com/2009/09/songsincode-lyrics-for-programmers.html">#songsincode - Lyrics for Programmers</a> - a countdown of the finest #songsincode</li>
<li><a href="http://www.weedoorsbanging.com/archives/songs-in-code.html">songs in code at wee doors banging</a> - a selection of #songsincode by John Girvin</li>
<li><a href="http://juixe.com/techknow/index.php/2009/08/22/songs-in-code/">Songs in Code at Juixe Techknow</a> - an early collection of about 60 #songsincode</li>
<li><a href="http://www.redcode.nl/random/blog/8.html">#songsincode on redcode.nl</a> - a selection of #songsincode by Roy van Rijn</li>
<li><a href="http://songsincodedb.com/">Songs in Code Database</a> - automatically updated with the latest tweets</li>
</ul></p>
]]></content:encoded>
			<wfw:commentRss>http://programmersdiary.today.com/2009/09/26/songs-in-code/feed/</wfw:commentRss>
		</item>
		<item>
		<title>Writing a Small Operating System</title>
		<link>http://programmersdiary.today.com/2009/08/17/writing-a-small-operating-system/</link>
		<comments>http://programmersdiary.today.com/2009/08/17/writing-a-small-operating-system/#comments</comments>
		<pubDate>Mon, 17 Aug 2009 09:35:30 +0000</pubDate>
		<dc:creator>impomatic</dc:creator>
		
		<category><![CDATA[Programming]]></category>

		<category><![CDATA[microkernel]]></category>

		<category><![CDATA[operating system]]></category>

		<guid isPermaLink="false">http://programmersdiary.today.com/2009/08/17/writing-a-small-operating-system/</guid>
		<description><![CDATA[I&#8217;ve just rediscovered a project I started in 1997 and have always intended to go back and complete one day. The project is a small operating system suitable for microcontrollers.
The OS will provide the following functionality, similar to a MicroKernel:

memory management (done)
preemptive task switching (done)
process management (done)
inter process communication

Memory Management
Memory is divided into variable size [...]]]></description>
			<content:encoded><![CDATA[<p>I&#8217;ve just rediscovered a project I started in 1997 and have always intended to go back and complete one day. The project is a small operating system suitable for microcontrollers.</p>
<p>The OS will provide the following functionality, similar to a MicroKernel:</p>
<ul>
<li>memory management (done)</li>
<li>preemptive task switching (done)</li>
<li>process management (done)</li>
<li>inter process communication</li>
</ul>
<h2>Memory Management</h2>
<p>Memory is divided into variable size block, each preceded by a small memory control stucture. The structure contains the following:</p>
<ul>
<li>link to previous block</li>
<li>link to next block</li>
<li>link to owner of block</li>
<li>length of block</li>
<li>in use flag: is this block available?</li>
<li>ready flag: is process ready to execute?</li>
<li>stack pointer: sp saved when not active</li>
</ul>
<p>Functions to allocate / free memory are provided. Have I missed anything important?</p>
<h2>Task Switcher</h2>
<p>The task switcher is called by the timer interrupt and switches to the next available task. Switching is disabled while memory is being allocated / freed.</p>
<h2>Process Management</h2>
<p>Functions are provided to create new processes, kill processes, mark a process as available or blocked. Switching is disabled while processes are being manipulated.</p>
<h2>Inter Process Communication</h2>
<p>Semaphores and message passing will be implemented. Unfortunately, I stumbled across a problem. How do I get two processes to agree which semaphore / message to use?</p>
<p>Should they be numbered, named or referred to by an address in memory? Should a semaphore / message buffer be allocated to each process or block of memory? If named, how should I handle name collisions?</p>
<p>Any advice on implementing IPC would be appreciated.</p>
]]></content:encoded>
			<wfw:commentRss>http://programmersdiary.today.com/2009/08/17/writing-a-small-operating-system/feed/</wfw:commentRss>
		</item>
		<item>
		<title>Stop Reading and Get Some Programming Done</title>
		<link>http://programmersdiary.today.com/2009/07/21/stop-reading-and-get-some-programming-done/</link>
		<comments>http://programmersdiary.today.com/2009/07/21/stop-reading-and-get-some-programming-done/#comments</comments>
		<pubDate>Tue, 21 Jul 2009 19:21:22 +0000</pubDate>
		<dc:creator>impomatic</dc:creator>
		
		<category><![CDATA[Programming]]></category>

		<guid isPermaLink="false">http://programmersdiary.today.com/2009/07/21/stop-reading-and-get-some-programming-done/</guid>
		<description><![CDATA[At the moment I have two major projects on the go, but so far this week I&#8217;ve only written seven lines of code! Despite this I&#8217;ve managed to either read or skim through a variety of papers / articles about programming (listed below).
It&#8217;s got to stage where I need to tell myself the same thing [...]]]></description>
			<content:encoded><![CDATA[<p>At the moment I have two major projects on the go, but so far this week I&#8217;ve only written seven lines of code! Despite this I&#8217;ve managed to either read or skim through a variety of papers / articles about programming (listed below).</p>
<p>It&#8217;s got to stage where I need to tell myself the same thing most recreational programmers need to be told from time to time:</p>
<p>
<h2>Stop reading about programming and get some actual programming done.</h2>
</p>
<p>Here are the papers I&#8217;ve read, all unrelated to either of the projects I&#8217;m working on!</p>
<ul>
<li><i>On &micro;-Kernel Construction</i>, Jochen Liedtke, 1995. On the design and implementation of micro kernels.</li>
<li><a href="http://brinch-hansen.net/papers/1970a.pdf"><i>The Nucleus of a Multiprogramming System</i></a>, P Brinch Hansen, 1970. A early paper describing a micro kernel.</li>
<li><a href="http://www.complang.tuwien.ac.at/anton/euroforth/ef08/papers/pelc.pdf"><i>Updating the Forth Virtual Machine</i></a>, Stephen Pelc, 2008. Explores some changes to Forth, notably address registers.</li>
<li><a href="http://www.cs.duke.edu/~ola/papers/bubble.pdf"><i>Bubble Sort: An Archaeological Algorithmic Analysis</i></a>, Owen Astrachan, 2003. Investigates the history of Bubble Sort.</li>
<li><a href="http://homepages.cwi.nl/~paulv/papers/sorting.pdf"><i>Analysis of Sorting Algorithms by Kolmogorov Complexity (A Survey)</i></a>, Paul Vit&aacute;nyi, 2003. In depth.</li>
<li><a href="http://cs.clackamas.cc.or.us/molatore/cs260Spr03/combsort.htm"><i>A Fast Easy Sort</i></a>, Stephen Lacey and Richard Box, 1991. Describes Comb Sort (also known as Dobosiewicz Sort).</li>
</ul>
]]></content:encoded>
			<wfw:commentRss>http://programmersdiary.today.com/2009/07/21/stop-reading-and-get-some-programming-done/feed/</wfw:commentRss>
		</item>
		<item>
		<title>Progress Report: My Forth Interpreter</title>
		<link>http://programmersdiary.today.com/2009/07/15/progress-report-my-forth-interpreter/</link>
		<comments>http://programmersdiary.today.com/2009/07/15/progress-report-my-forth-interpreter/#comments</comments>
		<pubDate>Wed, 15 Jul 2009 12:37:02 +0000</pubDate>
		<dc:creator>impomatic</dc:creator>
		
		<category><![CDATA[Programming]]></category>

		<category><![CDATA[forth]]></category>

		<guid isPermaLink="false">http://programmersdiary.today.com/2009/07/15/progress-report-my-forth-interpreter/</guid>
		<description><![CDATA[Implementing my own Forth interpreter is taking a little longer than anticipated. Each Forth word is almost like a puzzle. What&#8217;s the smallest number of words each can be written in? What&#8217;s the most efficient implementation? For an example, take a look at Implementing MIN in Forth without Conditional Code. The smallest version of MIN [...]]]></description>
			<content:encoded><![CDATA[<p>Implementing my own Forth interpreter is taking a little longer than anticipated. Each Forth word is almost like a puzzle. What&#8217;s the smallest number of words each can be written in? What&#8217;s the most efficient implementation? For an example, take a look at <a href="http://retrocode.blogspot.com/2009/06/implement-min-in-forth-without.html">Implementing MIN in Forth without Conditional Code</a>. The smallest version of MIN is 2 words shorter than eForth&#8217;s MIN.</p>
<p>Even words with a trivial implementation can pose an interesting problem. For example which of the following is most efficient:</p>
<h3>Jones Forth TUCK (Corrected)</h3>
<p>&nbsp;</p>
<pre>: TUCK DUP -ROT ;</pre>
<p>&nbsp;</p>
<h3>Alternative TUCK</h3>
<p>&nbsp;</p>
<pre>: TUCK SWAP OVER ;</pre>
<p>&nbsp;</p>
<p>If DUP, -ROT, SWAP and OVER are all primative, the alternative implementation will execute two fewer instructions on an 80&#215;86 Forth. However, -ROT is often implemented in Forth which would cause the Jones Forth TUCK to be substantially slower. Here&#8217;s a typical implementation of -ROT:</p>
<p>&nbsp;</p>
<pre>: -ROT SWAP &gt;R SWAP R&gt; ;</pre>
<p>&nbsp;</p>
<p>Note: there&#8217;s an error in Jones Forth. The implementation of ROT and -ROT are reversed.</p>
<p>If you can think of an alternative two word implementation of TUCK or four word implementation of -ROT, please let me know.</p>
]]></content:encoded>
			<wfw:commentRss>http://programmersdiary.today.com/2009/07/15/progress-report-my-forth-interpreter/feed/</wfw:commentRss>
		</item>
		<item>
		<title>Programming Games: Request for Information</title>
		<link>http://programmersdiary.today.com/2009/06/04/programming-games-request-for-information/</link>
		<comments>http://programmersdiary.today.com/2009/06/04/programming-games-request-for-information/#comments</comments>
		<pubDate>Thu, 04 Jun 2009 21:22:34 +0000</pubDate>
		<dc:creator>impomatic</dc:creator>
		
		<category><![CDATA[Programming]]></category>

		<guid isPermaLink="false">http://programmersdiary.today.com/2009/06/04/programming-games-request-for-information/</guid>
		<description><![CDATA[Over the past few weeks I&#8217;ve been taking a closer look at a few early programming games. It&#8217;s disappointing to note there&#8217;s very little information about most of them online.
RobotWar by Silas Warner is the earliest example of a battle robot programming game, published by MUSE Software for the Apple II in 1981. Robots are [...]]]></description>
			<content:encoded><![CDATA[<p>Over the past few weeks I&#8217;ve been taking a closer look at a few early programming games. It&#8217;s disappointing to note there&#8217;s very little information about most of them online.</p>
<p><a href="http://corewar.co.uk/robotwar">RobotWar by Silas Warner</a> is the earliest example of a battle robot programming game, published by MUSE Software for the Apple II in 1981. Robots are programmed in a proprietary language. Apart from the <a href="http://en.wikipedia.org/wiki/RobotWar">RobotWar page on Wikipedia</a> and the results from the first four tournament in <a href="http://cgw.vintagegaming.org/">Computer Gaming World</a>, there&#8217;s no information online. If you remember RobotWar or the Postal RobotWar Club, I&#8217;d love to hear from you.</p>
<p><a href="http://corewar.co.uk/probots">P-Robots by David Malmberg</a> is another early example of a RobotWar style programming game, published as Shareware in 1988. Robots are written in a subset of Pascal. Later versions added features such as customizable robots. There&#8217;s very little information online, so I&#8217;d love to hear from you if you used to play P-Robots or have a copy of Robot Editor by BJ Gleason.</p>
<p><a href="http://retrocode.blogspot.com/2009/05/bf-joust-king-of-hill.html">BF Joust by ais523 / Kerim Aydin</a> is a capture the flag programming game designed in 2008. Programs are written in the Brainf*** esoteric programming language and an online King of the Hill tournament is available. For more information, see the <a href="http://esolangs.org/wiki/BF_Joust">BF Joust</a> Wiki page.</p>
<p>There are still three early programming games I need to take a closer look at, Darwin (1960s), C-Robots (1985) and Omega (1989). If you&#8217;re aware of any I haven&#8217;t mentioned published before 1990, please let me know. <img src='http://programmersdiary.today.com/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </p>
]]></content:encoded>
			<wfw:commentRss>http://programmersdiary.today.com/2009/06/04/programming-games-request-for-information/feed/</wfw:commentRss>
		</item>
		<item>
		<title>Lazy Programmer</title>
		<link>http://programmersdiary.today.com/2009/05/09/lazy-programmer/</link>
		<comments>http://programmersdiary.today.com/2009/05/09/lazy-programmer/#comments</comments>
		<pubDate>Sat, 09 May 2009 10:59:39 +0000</pubDate>
		<dc:creator>impomatic</dc:creator>
		
		<category><![CDATA[Misc]]></category>

		<category><![CDATA[Programming]]></category>

		<category><![CDATA[corelife]]></category>

		<category><![CDATA[corewar]]></category>

		<category><![CDATA[koth]]></category>

		<category><![CDATA[the recursive universe]]></category>

		<guid isPermaLink="false">http://programmersdiary.today.com/2009/05/09/lazy-programmer/</guid>
		<description><![CDATA[Over the past few weeks I&#8217;ve been a pretty lazy programmer!   First I spent a few days camping in Norfolk without access to a computer or any decent books. Luckily I found a copy of The Recursive Universe by William Poundstone in one of Holt&#8217;s secondhand bookshops. It makes a pretty good browse [...]]]></description>
			<content:encoded><![CDATA[<p>Over the past few weeks I&#8217;ve been a pretty lazy programmer!  <img src="http://programmersdiary.today.com/wp-includes/js/tinymce/plugins/emotions/images/smiley-smile.gif" alt="Smile" border="0" /> First I spent a few days camping in Norfolk without access to a computer or any decent books. Luckily I found a copy of <a href="http://retrocode.blogspot.com/2009/04/recursive-universe-by-william.html">The Recursive Universe</a> by William Poundstone in one of Holt&#8217;s secondhand bookshops. It makes a pretty good browse while sitting on the riverbank with a picnic.</p>
<p>The last couple of weeks have been kind of hectic, but I&#8217;ve had the opportunity to look though a few of the programming games on Dennis Luehring&#8217;s <a href="http://aiforge.net/game-links.htm">list of programming games</a>. I picked out <a href="http://corewar.co.uk/corelife">CoreLife</a> to experiment with. CoreLife is similar to Corewar, but played in 2 dimensions. Currently I&#8217;m attempting to write a replicator.</p>
<p>Speaking of Corewar, this month started off with some sad news. KOTH.org is to close at the end of May and will be missed by the everyone involved. KOTH has served the Corewar community for 15 years, providing a King of the Hill tournament, mailing list and IRC channel.</p>
<p>KOTH&#8217;s IRC channel has already moved to <a href="irc://irc.freenode.net/#COREWARS">#COREWARS</a> on irc.freenode.net and the KOTH webpage has been archive to ensure it won&#8217;t fall victim to bitrot. The fate of the hills and mailing list is still being discussed.</p>
]]></content:encoded>
			<wfw:commentRss>http://programmersdiary.today.com/2009/05/09/lazy-programmer/feed/</wfw:commentRss>
		</item>
		<item>
		<title>Holiday is Over - Programming Report</title>
		<link>http://programmersdiary.today.com/2009/04/12/holiday-is-over-programming-report/</link>
		<comments>http://programmersdiary.today.com/2009/04/12/holiday-is-over-programming-report/#comments</comments>
		<pubDate>Sun, 12 Apr 2009 17:35:05 +0000</pubDate>
		<dc:creator>impomatic</dc:creator>
		
		<category><![CDATA[Misc]]></category>

		<category><![CDATA[holiday]]></category>

		<guid isPermaLink="false">http://programmersdiary.today.com/2009/04/12/holiday-is-over-programming-report/</guid>
		<description><![CDATA[After spending a week on the Isle of Wight, I&#8217;ve finally returned to the civilized world. Thanks to Lawrence for recommending Zen and the Art of Motorcycle Maintenance, although in the end I didn&#8217;t have enough time to finish reading it.
Programming Report
Most days I was up about an hour or so before everyone else, which [...]]]></description>
			<content:encoded><![CDATA[<p>After spending a week on the Isle of Wight, I&#8217;ve finally returned to the civilized world. Thanks to Lawrence for recommending <i>Zen and the Art of Motorcycle Maintenance</i>, although in the end I didn&#8217;t have enough time to finish reading it.</p>
<h2>Programming Report</h2>
<p>Most days I was up about an hour or so before everyone else, which proved to be my only chance to get any programming done. The only technology I had available was a Nintendo DS, with a R4 flash cartridge.</p>
<p>The R4 cartridge allows the DS to run downloaded homebrew software. DSOrganise is one of the best and includes an editor, IRC software and a simple web browser. Unfortunately, I never found a WiFi connection to use the Internet.</p>
<p>The DS turned out to be handy after all, since I downloaded the ANS 94 Forth Standard and eForth to the R4. I managed to implement a couple of dozen words in assembly over the week <img src='http://programmersdiary.today.com/wp-includes/images/smilies/icon_smile.gif' alt=':-)' class='wp-smiley' /> </p>
]]></content:encoded>
			<wfw:commentRss>http://programmersdiary.today.com/2009/04/12/holiday-is-over-programming-report/feed/</wfw:commentRss>
		</item>
		<item>
		<title>When a Programmer goes on Holiday</title>
		<link>http://programmersdiary.today.com/2009/04/02/when-a-programmer-goes-on-holiday/</link>
		<comments>http://programmersdiary.today.com/2009/04/02/when-a-programmer-goes-on-holiday/#comments</comments>
		<pubDate>Thu, 02 Apr 2009 22:12:05 +0000</pubDate>
		<dc:creator>impomatic</dc:creator>
		
		<category><![CDATA[Misc]]></category>

		<category><![CDATA[books]]></category>

		<guid isPermaLink="false">http://programmersdiary.today.com/2009/04/02/when-a-programmer-goes-on-holiday/</guid>
		<description><![CDATA[First thing tomorrow I&#8217;ll be heading south to spend a week in the great outdoors. Although my laptop is staying at home, I&#8217;m planning to program something worthwhile with a handful of scrap paper and a few hand-written notes.
Since I didn&#8217;t have time to order a book about Forth, there&#8217;s still some space available in [...]]]></description>
			<content:encoded><![CDATA[<p>First thing tomorrow I&#8217;ll be heading south to spend a week in the great outdoors. Although my laptop is staying at home, I&#8217;m planning to program something worthwhile with a handful of scrap paper and a few hand-written notes.</p>
<p>Since I didn&#8217;t have time to order a book about Forth, there&#8217;s still some space available in my rucksack. There&#8217;s a few on my bookshelf I haven&#8217;t read. Which should I take for inspiration and what should I leave at home to avoid the distraction?</p>
<ul>
<li><i>The Emperor&#8217;s New Mind</i>, Roger Penrose</li>
<li><i>Zen and the Art of Motorcycle Maintenance</i>, Robert M. Pirsig</li>
<li><i>Unsolved Problems in Number Theory</i>, Richard K. Guy</li>
<li><i>For Whom the Bell Tolls</i>, Ernest Hemingway</li>
<li><i>my tiny life</i>, Julian Dibbell</li>
<li><i>Crypto</i>, Steven Levy</li>
</ul>
]]></content:encoded>
			<wfw:commentRss>http://programmersdiary.today.com/2009/04/02/when-a-programmer-goes-on-holiday/feed/</wfw:commentRss>
		</item>
		<item>
		<title>URISC / OISC: One Instruction Computers</title>
		<link>http://programmersdiary.today.com/2009/03/30/urisc-oisc-one-instruction-computers/</link>
		<comments>http://programmersdiary.today.com/2009/03/30/urisc-oisc-one-instruction-computers/#comments</comments>
		<pubDate>Mon, 30 Mar 2009 13:59:59 +0000</pubDate>
		<dc:creator>impomatic</dc:creator>
		
		<category><![CDATA[Programming]]></category>

		<category><![CDATA[oisc]]></category>

		<category><![CDATA[rssb]]></category>

		<category><![CDATA[subleq]]></category>

		<category><![CDATA[subneg]]></category>

		<category><![CDATA[urisc]]></category>

		<guid isPermaLink="false">http://programmersdiary.today.com/2009/03/30/urisc-oisc-one-instruction-computers/</guid>
		<description><![CDATA[URISC is an abstract computer designed to have a minimal instruction set, just one machine code instruction. The practical uses of URISC are debatable.URISC is an abbreviation of Ultimate RISC, although technically the machine doesn&#8217;t meet the criteria for RISC. OISC is an acronym for One Instruction Set Computer, although One Instruction Computer would be [...]]]></description>
			<content:encoded><![CDATA[<p>URISC is an abstract computer designed to have a minimal instruction set, just one machine code instruction. The practical uses of URISC are debatable.URISC is an abbreviation of Ultimate <acronym title="Reduced Instruction Set Computer">RISC</acronym>, although technically the machine doesn&#8217;t meet the criteria for <acronym title="Reduced Instruction Set Computer">RISC</acronym>. OISC is an acronym for One Instruction Set Computer, although One Instruction Computer would be a clearer description.<br />
<h3>Types of URISC</h3>
<p>There are four common types of URISC - MOV, RSSB, SUBLEQ and SUBNEG.<br />
<h3>MOV - Transport Triggered Architecture</h3>
<p>In a MOV URISC machine there is just one instruction with two operands. When the instruction executes, it copies one location in memory to another, using the operands as pointers. Jumps, arithmetic and input / output are achieve with a memory mapped program counter, arithmetic unit and input / output ports.More information about MOV TTA:
<ul>
<li><a href="http://en.wikipedia.org/wiki/Transport_triggered_architecture">Transport Triggered Architecture</a></li>
</ul>
<h3>RSSB - Reverse Subtract and Skip if Borrow</h3>
<p>The instruction in a RSSB URISC machine is Reverse Subtract and Skip if Borrow. Each instruction has one operand which is a pointer into memory. When the instruction executes, it subtracts the accumulator from a memory location and stores the result in both. If the value in memory was lower than the accumulator, the next instruction will be skipped. The program counter, accumulator and input / output are mapped to memory.More information about RSSB:
<ul>
<li><a href="http://retrocode.blogspot.com/2009/01/ultimate-risc-one-instruction-set.html">The Ultimate RISC, One Instruction Computers</a></li>
<li><a href="http://retrocode.blogspot.com/2009/01/hello-world-for-rssb-virtual-computer.html">Hello World for the RSSB Virtual Computer</a></li>
<li><a href="http://impomatic.blogspot.com/2009/01/redcode-interpretter-for-rssb-single.html">Redcode Interpreter for the RSSB Virtual Computer</a></li>
</ul>
<h3>SUBNEG - Subtract and Branch if Negative</h3>
<p>Also abbreviated to SBN, a SUBNEG computer uses an instruction with three operands. When executed, SUBNEG subtracts the contents of the first memory location from a second location, storing the result in the second. If the first value was higher than the second, SUBNEG jumps to where the third operand points. Input / output are memory mapped.More information about SUBNEG:
<ul>
<li><a href="http://bitstuff.blogspot.com/2007/02/subtract-and-branch-if-negative.html">A SBN Computer Built from 74xx Gates</a></li>
</ul>
<h3>SUBLEQ - Subtract and Branch if Less than or Equal</h3>
<p>SUBLEQ is similar to a SUBNEG computer, but also branches if the contents of the two memory locations is identical.More information about SUBLEQ:
<ul>
<li><a href="http://techtinkering.com/blog/?id=22">Hello‚ World! in SUBLEQ Assembly</a></li>
<li><a href="http://techtinkering.com/blog/?id=20">The SUBLEQ URISC / OISC Architecture</a></li>
<li><a href="http://www.redcode.nl/random/blog/1.html">SUBLEQ Interpreter in Redcode</a></li>
<li><a href="http://eigenratios.blogspot.com/2006/09/mark-ii-oisc-self-interpreter.html">SUBLEQ Self Interpreter</a></li>
</ul>
]]></content:encoded>
			<wfw:commentRss>http://programmersdiary.today.com/2009/03/30/urisc-oisc-one-instruction-computers/feed/</wfw:commentRss>
		</item>
	</channel>
</rss>


