Mar
30
2009
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’t meet the criteria for RISC. OISC is an acronym for One Instruction Set Computer, although One Instruction Computer would be a clearer description.
Types of URISC
There are four common types of URISC - MOV, RSSB, SUBLEQ and SUBNEG.
MOV - Transport Triggered Architecture
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:
RSSB - Reverse Subtract and Skip if Borrow
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:
SUBNEG - Subtract and Branch if Negative
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:
SUBLEQ - Subtract and Branch if Less than or Equal
SUBLEQ is similar to a SUBNEG computer, but also branches if the contents of the two memory locations is identical.More information about SUBLEQ:
Mar
27
2009
In a programming game, players write programs to compete towards some goal, for example destroying all opponents or capturing a flag. There are two main types of programming games:
- inspired by RobotWar - programs control a robot or tank which moves around an arena firing at the opponent - RobotWar was written in the 1970s.
- inspired by Darwin - programs execute in a virtual computer and attempt to modify and crash the opponent. Darwin was first played in the 1960s.
Each game has spawned a series of clone - the most popular being CRobots (1985) and Core War (1984).In Core War, players write programs in Redcode, the assembly language of a virtual computer. The aim of the game is to survive while causing all opponents to terminate. There are three basic techniques which the majority of battle programs use in some combination:
- paper - the program spawns off new copies of itself in the hope at least one on the copies will survive.
- scissors - the program searches for the opponent. When something is found, it attempts to disable it.
- stone - the program drops instructions in a pattern through memory to hopefully damage the opponent.
A couple of years after A. K. Dewdney introduced the world to Core War, A society was formed, which held an annual tournament. The First International Core War Tournament held in the Computer Museum, Boston MA was a great success, with a paper coming out on top, Mice by Chip Wendell.Core War is now played as a King of the Hill tournament. Players submit their entry by email to a hill containing some of the top Core War programs, receiving results a few minutes later. If the program is successful, it enters the hill, knocking off the lowest warrior.Despite having reached it’s 25th birthday, Core War still has a community of regular players. Although the major techniques appear to have been discovered, new ideas are constantly being tested, occasionally with impressive results. If you’d like to find out more about Corewar, here are some useful links for beginners:
If you’re planning to try your hand at writing a battle program, good luck and may the core be with you!
Mar
25
2009
I’ve been curious about Forth ever since college. Now I’ve got some time on my hands, it seems like the ideal opportunity to investigate further.
Unfortunately the only Forth book I have is Advanced Spectrum Forth by Don Thomasson. The book covers the basics of Forth before moving on to more complex topics. The problem is it describes an ancient Forth standard, fig-Forth.
Modern Forth
After a quick seach, I turned up the ANS Forth Standard 1994 and the draft Forth 200x Standard. There are substantial differences to fig-Forth, which more or less makes the book useless.
I discovered a Forth IRC channel, #forth on irc.freenode.net where a community of Forth programmers gather. They gave me some pointers to some minimal Forth implementations:
However, the most useful pointers have been a couple of articles about implementing and moving Forth:
After reading through these, I’ve made a number of implementation decisions.
I’m planning to create a Forth interpreter in 8086 assembly, and later translate it to the AVR microcontroller on the Arduino board. I’ll use the processor stack for Forth’s data stack and use a register for the return stack. The top of stack element will be kept in a register.
However, there’s one small problem. At the end of the month I’ll be away from the Internet, spending a week on the beach. Can anyone recommend a good Forth book I can take with me?
Mar
25
2009
“Hi, my name is John and I’m addicted to programming.”
Hang on a moment, that’s Tuesday nights, today is Wednesday. 
I’ve created Programmer’s Diary as a place to discuss my latest projects and hopefully get some feedback. I must warn you though, I rarely finish more than 1 in 4 of the projects I start!