xComputer Challenges

Instructions

Try these challenges in ORDER. They are specifically designed for the xComputer environment, although the programs should be writable in any assembler or machine language environment. Note that most of the examples involve labelled cells, so you will need to adapt the programs if your assembler does not support this feature.

Challenge 1: Store a value

Store the value 10 in cell 50

Challenge 2: Store in a named cell

Store the value 10 in a cell named target

Challenge 3: Simple adder

Given cells a, b, and result, write a program that adds a and b, and puts answer in result

Challenge 4: Decrement startval

Given a value in a cell called startval, decrease that value by one as many times as necessary until the value is zero.

Challenge 5: Improved counter

Given a value in a cell called startval, loop as many times as necessary for startval to get to zero (as in last program). Have another cell named counter. At the end of the run, counter should contain the number of repetitions that occurred.

Challenge 6: Count by threes

Improve the last program so by the end of the run, it shows three times the number of repetitions that occurred

Challenge 7: Multiplier

Given cells a, b, and product, write a program that multiplies a times b and stores the result into product.
© Andy Harris
Indiana University / Purdue University, Indianapolis
email: aharris@cs.iupui.edu
homepage: http://www.cs.iupui.edu/~aharris