| |
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.
- Assign a name to your Block by clicking on 'label'. Call this TOTAL.
- Click on 'num' and choose Decimal and 1 from the two popup dialogues.
- Assign names to your Words by clicking on 'label'. Call the first one
'ABC' and the second 'XYZ'.
- Click on 'const' to assign values to your Words. Set ABX equal to 2
and XYZ equal to 3.
- Click on 'reg' to choose which register to Load your Words into. Load
ABC into Register D and XYZ into Register E.
- 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.
- Click on 'reg' in the Store line and choose Register F.
- Click on 'label' and choose TOTAL.
- 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.
|