CSCI 201 Spring 2003

Short Assignment 1: Assembly Level Programming Using Little Man Computer

In this assignment, you will work with Little Man Computer, a computer simulation program developed to introduce students to the basic functions of the CPU. Little Man Computer can be either run interactively over the internet or downloaded to your computer using the following link.

View the attached power point slides and then answer the questions below. Your answers should be submitted in hard copy at the start of class one week from the date that this assignment is given.

Questions

  1. Using the Little Man Computer program layout as shown on the slides (that is, using Mailbox Address, Code, and Instruction Description columns), write a program that outputs the odd numbers from 1 to 9 in ascending order. You can only receive at most two input values - the values 1 (this is the first odd number to output) and 2 (adding this number to the previous odd number will give you the next odd number to output). You cannot start with any data already in memory. Be sure to start your instructions at mailbox #00 and any data you store should begin in mailbox #99 and then proceed in descending order. You should not need more than 15 instructions for this entire program.


  2. Suppose the Little Man Computer had been implemented as a 16-bit binary machine (that is, instead of using Base 10 and only 3-digit numbers, now it uses Base 2 and 16 bits for each instruction). Assume that the binary LMC provides an same instruction set that is the same as LMC with one exception: in the binary LMC there is only one "Skip" instruction, "Skip If Zero" with op code 8. Assume all other op codes are the same (in binary, of course), and that the binary LMC uses the same instruction format (op code followed by address).