What to do for this assignment where you will write a program that draws lines on PennSim’s graphic display, similar to an Etch A Sketch. The program…


For more explanation about the PennSim display, see the PennSim Reference Manual.

The ASCII code for the Return key is x0A (#10).  This is listed as linefeed (LF) in the ASCII table.

Hints and Suggestions

As always, design before you code!  Draw a flowchart to organize and document your thinking before you start writing the program.

Work incrementally!  For example, implement one command at a time.  Make sure the program works before moving on to the next command.  This way, you always have working code.

It’s not a bad idea to save each working version of your program.  Then, if your machine crashes (it happens!), you haven’t lost everything. 

Test your program with a wide variety of inputs.  Make sure that you have tested the “corner cases,” such as reaching the border of the display.

Use the PennSim simulator and assembler.  There are other simulators and assemblers out there, but there are some differences.  Your program will be graded using PennSim, and no other tools will be used or considered.