72 Section 6: Programming Basics

 

Keystrokes

Display

 

 

 

´bA

001-42,21,11

Assigns this program the label

 

 

 

 

―A‖.

O0

002-

44

0

Stores the contents of X-register

 

 

 

 

into R0. r must be in the X-

 

 

 

 

register before running the

 

 

 

 

program.

x

003-

43

11

Squares the contents of the X-

 

 

 

 

register (which will be r).

$

004-

43

26

 

*

005-

 

20

π 2

 

 

 

r , the BASE AREA of a can.

O4

006-

44

4

Stores the BASE AREA in R4.

O+1

007-44,40, 1

Keeps a sum of all BASE

 

 

 

 

AREAS in R1.

¦

008-

 

31

Stops to display BASE AREA

 

 

 

 

and allow entry of the h value.

*

009-

 

20

Multiplies h by the BASE

 

 

 

 

AREA, giving VOLUME.

´©

010-

42

31

Pauses briefly to display

 

 

 

 

VOLUME.

O+2

011-44,40,

2

Keeps a sum of all can

 

 

 

 

VOLUMES in R2.

l0

012-

45

0

Recalls r.

÷

013-

 

10

Divides VOLUME by r.

2

014-

 

2

 

*

015-

 

20

π

 

 

 

2 rh, the SIDE AREA of a can.

l4

016-

45

4

Recalls the BASE AREA of the

 

 

 

 

can.

2

017-

 

2

Multiplies base area by two (for

*

018-

 

20

top and bottom).