0Bh BT$PPRG push/pop general word variables
Input - none -
Output - none -
Description

This system service routine will push or pop the seven variables UTW_R0 to UTW_R6 on the machine stack.

This system service must be followed by a control byte which contains the instructions for the service. Execution of code continues after the control byte.

The format of the control byte is as follows:

  • BIT 7 - If set then pop the variables else push the variables.
  • BIT 6 - If set then push or pop UTW_R6
  • BIT 5 - If set then push or pop UTW_R5
  • BIT 4 - If set then push or pop UTW_R4
  • BIT 3 - If set then push or pop UTW_R3
  • BIT 2 - If set then push or pop UTW_R2
  • BIT 1 - If set then push or pop UTW_R1
  • BIT 0 - If set then push or pop UTW_R0

Thus if the byte value is $5 then UTW_R2 and UTW_R0 will be pushed.

When pushing, the higher addressed variables are pushed first and when popping, the lower address variables are popped first. Thus if UTW_R5 and UTW_R2 are pushed and UTW_R2 and UTW_R1 are popped then UTW_R1 will get the old value of UTW_R2 and UTW_R2 will get the old value of UTW_R5.

NOTE: no check is made to ensure that there is room on the machine stack to take all the variables pushed.

Example
        OS      BT$PPRG                 ; PUSH UTW_R0
        DB      1                       ; INSTRUCTION BYTE TO BT$PPRG
 
        ; CAN NOW USE UTW_R0
 
        OS      BT$PPRG                 ; POP UTW_R0
        DB      81h                     ; INSTRUCTION BYTE TO BT$PPRG
Errors - none -