42 The Processor and the Operating System Stack Group The Stack group of instructions provides you with operations for managing stacks. The instruc- tions withdraw items from (also called "pop" or "pull") or push items onto a stack pointed to by either the C or D register. The items are pushed from or withdrawn into a specified register (other than C or D) and the C or D register is incremented or decremented appropriately. Pushing instructions increment or decrement the C or D register prior to doing the pushing. Withdrawing instructions increment or decrement the C or D register after doing the with- drawal.
Consequently, the pointer is always left pointing to the "top" of the stack after the operation. Decrementing the C or D register is indicated by including , I:i after the operand. For "with- drawing" instructions, D is the default. For example, the following are equivalent - Incrementing is specified by including, I after the operand. This is also the default for "push- ing" instructions if neither I or D is included. For example, the following are equivalent - F'l .. ·jC h, I When using the byte instructions (PBC, PBD, WBC, WBD), the address pointed to by the C or D register must not have an absolute address less than 408.
When pushing or withdrawing bytes, the least significant bit of the address register (either C or D) is used to determine which byte is desired in the stack (a 0 implies the left most byte of the word being addressed). To retain the full 16-bit addressing capability, the Cb or Db register is used, as appropriate. These one-bit registers hold the most significant bit of the word address when the byte addressing instructions are used. They should be explicitly set or cleared, depending upon the value of the address involved.