| Routines

08188: THE 'PRINT ITEMS' SUBROUTINE

This subroutine is called from the PRINT_2 and INPUT routines. The various types of print item are identified and printed.
PR_ITEM_1 | 08188 | RST 24 | The first character is fetched.
| 08189 | CP 172 | Jump forward unless it is an 'AT'.
| 08191 | JR NZ,PR_ITEM_2
Now deal with an 'AT'.
| 08193 | CALL NEXT_2NUM | The two parameters are transferred to the calculator stack.
| 08196 | CALL UNSTACK_Z | Return now if checking syntax.
| 08199 | CALL STK_TO_BC | The parameters are compressed into the BC register pair.
| 08202 | LD A,22 | The A register is loaded with the AT control character before the jump is taken.
| 08204 | JR PR_AT_TAB
Next look for a 'TAB'.
PR_ITEM_2 | 08206 | CP 173 | Jump forward unless it is a 'TAB'.
| 08208 | JR NZ,PR_ITEM_3
Now deal with a 'TAB'.
| 08210 | RST 32 | Get the next character.
| 08211 | CALL CLASS_06 | Transfer one parameter to the calculator stack.
| 08214 | CALL UNSTACK_Z | Return now if checking syntax.
| 08217 | CALL FIND_INT2 | The value is compressed into the BC register pair.
| 08220 | LD A,23 | The A register is loaded with the TAB control character.
The 'AT' and the 'TAB' print items are printed by making three calls to PRINT_A_1.
PR_AT_TAB | 08222 | RST 16 | Print the control character.
| 08223 | LD A,C | Follow it with the first value.
| 08224 | RST 16
| 08225 | LD A,B | Finally print the second value, then return.
| 08226 | RST 16
| 08227 | RET
Next consider embedded colour items.
PR_ITEM_3 | 08228 | CALL CO_TEMP_3 | Return with carry reset if colour items were found. Continue if none were found.
| 08231 | RET NC
| 08232 | CALL STR_ALTER | Next consider if the stream is to be changed.
| 08235 | RET NC | Continue unless it was altered.
The print item must now be an expression, either numeric or string.
| 08236 | CALL SCANNING | Evaluate the expression but return now if checking syntax.
| 08239 | CALL UNSTACK_Z
| 08242 | BIT 6,(IY+1) | Test for the nature of the expression (bit 6 of FLAGS).
| 08246 | CALL Z,STK_FETCH | If it is a string then fetch the necessary parameters; but if it is numeric then exit via PRINT_FP.
| 08249 | JP NZ,PRINT_FP
A loop is now set up to deal with each character in turn of the string.
PR_STRING | 08252 | LD A,B | Return now if there are no characters remaining in the string; otherwise decrease the counter.
| 08253 | OR C
| 08254 | DEC BC
| 08255 | RET Z
| 08256 | LD A,(DE) | Fetch the code and increment the pointer.
| 08257 | INC DE
| 08258 | RST 16 | The code is printed and a jump taken to consider any further characters.
| 08259 | JR PR_STRING