BDISP program listing

Program:

Comments:

 

 

«

 

«

Begins the main nested program.

DUP

Makes a copy of n.

-55 CF

Clears flag 55 to enable LASTARG.

IFERR

Begins error trap.

R→B

Converts n to a binary integer.

THEN

If an error occurs, do nothing (no commands in

END

the THEN clause).

→ n

Creates a local variable n and begins the defining

«

program.

CLLCD

Clears the display.

« BIN »

Nested program for BIN.

« OCT »

Nested program for OCT.

« DEC »

Nested program for DEC.

« HEX »

Nested program for HEX.

1 4

Sets the counter limits.

FOR j

Starts the loop with counter j.

EVAL

Executes one of the nested base programs

 

(initially for HEX).

n →STR

Makes a string showing n in the current base.

PAD

Pads the string to 22 characters.

j DISP

Displays the string in the jth line.

NEXT

Increments j and repeats the loop.

»

Ends the defining program.

3 FREEZE

Freezes the status and stack areas.

»

Ends the main nested program.

PRESERVE

Stores the current flag status, executes the main

 

nested program, and restores the status.

»

 

 

 

`OBDISP K

Stores the program in BDISP.

 

 

Checksum: # 22884d

Bytes: 187

RPL Programming Examples 2-9