Watson Assembly Tutorial


Home
Labs
Tutorials
Known Bugs
Schedule
Archive
Members
Contact Information

Editing Code (continued)

Now we have to assign names and values to our program. If you look at the code window you will notice that some of the code is in lower case. This is code that you need to assign some value to. To assign a value to that part of the code, move the mouse over the code and click once. An appropriate window popup allowing you to enter the needed values. Let's continue with the program.

  1. Assign a name to your Block by clicking on 'label'. Call this TOTAL.
  2. Click on 'num' and choose Decimal and 1 from the two popup dialogues.
  3. Assign names to your Words by clicking on 'label'. Call the first one 'ABC' and the second 'XYZ'.
  4. Click on 'const' to assign values to your Words. Set ABX equal to 2 and XYZ equal to 3.
  5. Click on 'reg' to choose which register to Load your Words into. Load ABC into Register D and XYZ into Register E.
  6. Going from left to right on the ADD line in the code choose registers F, D, E. This will Add the contents of registers D and E and store the result in register F.
  7. Click on 'reg' in the Store line and choose Register F.
  8. Click on 'label' and choose TOTAL.
  9. Now use the Run and Walk buttons to watch your program execute.

To erase code from the code editor, click the small 'o' to the left of the line of code you want to erase and choose 'Yes' when the dialogue box appears.

<< Back

Back to Tutorials

Next >>



Home | Labs | Tutorials | Known Bugs | Schedule | Archive | Members | Contact Information

For problems or questions regarding this site or the labs, contact the Watson Project.
Last updated: 10/22/03.