www.delorie.com/gnu/docs/bc/dc_6.html   search  
 
Buy GNU books!


dc, an arbitrary precision calculator

[ < ] [ > ]   [ << ] [ Up ] [ >> ]         [Top] [Contents] [Index] [ ? ]

6. Registers

DC provides at least 256 memory registers, each named by a single character. You can store a number in a register and retrieve it later.

`sr'
Pop the value off the top of the stack and store it into register r.

`lr'
Copy the value in register r, and push it onto the stack. This does not alter the contents of r.

Each register also contains its own stack. The current register value is the top of the register's stack.

`Sr'
Pop the value off the top of the (main) stack and push it onto the stack of register r. The previous value of the register becomes inaccessible.

`Lr'
Pop the value off the top of register r's stack and push it onto the main stack. The previous value in register r's stack, if any, is now accessible via the `lr' command.


  webmaster   donations   bookstore     delorie software   privacy  
  Copyright 2003   by The Free Software Foundation     Updated Jun 2003