72 Section 6: Programming Basics
Assigns this program the label
Stores the contents of X-register
into R
0
. r must be in the X-
register before running the
program.
Squares the contents of the X-
register (which will be r).
r
2
, the BASE AREA of a can.
Stores the BASE AREA in R
4
.
Keeps a sum of all BASE
AREAS in R
1
.
Stops to display BASE AREA
and allow entry of the h value.
Multiplies h by the BASE
AREA, giving VOLUME.
Pauses briefly to display
VOLUME.
Keeps a sum of all can
VOLUMES in R
2
.
2 rh, the SIDE AREA of a can.
Recalls the BASE AREA of the
can.
Multiplies base area by two (for
top and bottom).