dc: Registers
1
1 6 Registers
1 ***********
1
1 'dc' provides at least 256 memory registers(1), each named by a single
1 character. You can store a number in a register and retrieve it later.
1
1 'sR'
1 Pop the value off the top of the stack and store it into register
1 R.
1
1 'lR'
1 Copy the value in register R, and push it onto the stack. The
1 value '0' is retrieved if the register is uninitialized or its
1 stack has become empty. This does not alter the contents of R.
1
1 Each register also contains its own stack. The current register
1 value is the top of the register's stack.
1
1 'SR'
1 Pop the value off the top of the (main) stack and push it onto the
1 stack of register R. The previous value of the register becomes
1 inaccessible.
1
1 'LR'
1 Pop the value off the top of register R's stack and push it onto
1 the main stack. The previous value in register R's stack, if any,
1 is now accessible via the 'lR' command.
1
1 ---------- Footnotes ----------
1
1 (1) The exact number of registers provided by 'dc' depends on the
1 range of an 'unsigned char' in the C compiler used to create the 'dc'
1 executable.
1