[an error occurred while processing this directive]

Checklist: TOY Encryption

Frequently Asked Questions

What are the goals of this assignment? To learn to program in a machine language; to gain a better understanding of how variables are stored and manipulated in the computer; and to appreciate the programming and debugging advantages of a structured programming language like Java over machine language!

I can't launch the Java Web Start version of the Visual X-TOY simulator on my laptop. Any ideas? The program requires something called Web Start. When you installed Java initially, this was included. However, Windows security patches have been know to break it. If this happens to you, go to java.com and click the Get It Now button.

I can't launch the Java Web Start version of the Visual X-TOY simulator in the Moore 100 labs. Any ideas? The link in this assignment will not work on the Linux machines in the Moore 100 labs. Instead, select the Terminal from the start menu, and type "xtoy". The link in the assignment does work on the Windows machines, but there is also an icon for X-Toy in the Start Menu under the CIS 110 section of the Course Specific Software menu.

How do I format the TOY output? You can't. Just print one integer per line (0000 or 0001).

My program prints out the right answer, but then I get java.lang.NumberFormatException: null. What could be wrong? You are probably trying to read from standard input, even though it is empty. Be sure that your TOY program terminates when it encounters FFFF.

How do I write/comment a .toy file? To initialize a location in memory to have a value, write (on its own line) the index of the memory location (two hex digits), followed by a colon, followed by a space, followed by the value (four hex digits). Anything else on the line is ignored by the TOY simulator and treated as a comment. Any line that does not follow this format is also interpreted as a comment, but you should begin comment lines with "//" as a matter of good style.

TOY.java doesn't read in some of my instructions. Any ideas? Be sure that you follow the required format XX: XXXX. Check for duplicated line numbers and using the letter O instead of the number 0.

How much do I need to comment my TOY code? At a minimum, you should:

Developing a TOY Program

To simulate the execution of your program on a TOY machine, use either the bare-bones TOY.java or the full-blown Visual X-TOY simulator. To get started, download the sample TOY program multiply.toy.

Visual X-TOY simulator. The Visual X-TOY simulator from lecture provides lots of useful development features. There are three modes (edit, debug, and machine). Download it from the link on the assignment page.

Command-line TOY simulator. Download the TOY simulator using the link on the assignment page.

Debugging
Here are some debugging hints that may help you out.