Assignment 2

 

CISC221, Fall 2001

Queen's University

Due: October 25, 2001 11:00

Where: in drop box 221 Goodwin Hall second floor

No late assignments!

See below notes for instructions.

The purpose of this assignment is to introduce you to the use of the Pep/6 environment and coding of assembly language programs. It is intended to be very simple.

Assignment 2: A simple PEP/6 Assembly program

Write a program for the Pep/6 which reads two ascii words (i.e., the words you find in a book, not integer words), of 4 lowercase 8-bit characters each, from the input, and that outputs the two words again in the correct alphabetical order.

Input will be restricted to 4 character words only, so you do not need to handle any longer or shorter words! The alphabetical order is of course indicated by the first character. If the first characters are the same, you compare the second characters. You do not need to go beyond this.

For example:

  1. if the input is 'well' and 'cell' then the output would be 'cell well' with one space in between the words.
  2. if the input is 'what' and 'well' then the output would be 'well what' with one space in between the words.
  3. if the input is 'when' and what' then the output would be 'when what' as the two words cannot be distinguished.

Test your program with inputs which execute all the instructions.

Hints

It is strongly recommended that you write (and even compile and test) your solution in a high-level language, before translating it carefully to assembler.

Use the PEP/6 simulator in the labs to write and test your programs.

Where to Submit

Due: Tuesday October 24, 2000 before class (12:00). Please put your submission in the drop-off box marked CISC221B next to Goodwin Hall 235. Late assignments are not accepted.

What to Submit

Your (hard-copy) submission should include:

(1) The printout of of your assembly language program. You can use the listing file produced by the assembler, to get a nicely formatted file without extra effort. You will get marks for including comments in your program code!!!

(2) One page documentation. Should include a small manual for running the program, rationale for your design choices and a number of test cases with results, with rationale for using those cases.

Make sure your name and student number are on every page. Please number and staple pages together in a way that allows us to read them. For a complete overview of instructions regarding submission, see Assignments