| Routines

1FFC: 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 | 1FFC | RST $18 | The first character is fetched.
| 1FFD | CP $AC | Jump forward unless it is an 'AT'.
| 1FFF | JR NZ,PR_ITEM_2
Now deal with an 'AT'.
| 2001 | CALL NEXT_2NUM | The two parameters are transferred to the calculator stack.
| 2004 | CALL UNSTACK_Z | Return now if checking syntax.
| 2007 | CALL STK_TO_BC | The parameters are compressed into the BC register pair.
| 200A | LD A,$16 | The A register is loaded with the AT control character before the jump is taken.
| 200C | JR PR_AT_TAB
Next look for a 'TAB'.
PR_ITEM_2 | 200E | CP $AD | Jump forward unless it is a 'TAB'.
| 2010 | JR NZ,PR_ITEM_3
Now deal with a 'TAB'.
| 2012 | RST $20 | Get the next character.
| 2013 | CALL CLASS_06 | Transfer one parameter to the calculator stack.
| 2016 | CALL UNSTACK_Z | Return now if checking syntax.
| 2019 | CALL FIND_INT2 | The value is compressed into the BC register pair.
| 201C | LD A,$17 | 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 | 201E | RST $10 | Print the control character.
| 201F | LD A,C | Follow it with the first value.
| 2020 | RST $10
| 2021 | LD A,B | Finally print the second value, then return.
| 2022 | RST $10
| 2023 | RET
Next consider embedded colour items.
PR_ITEM_3 | 2024 | CALL CO_TEMP_3 | Return with carry reset if colour items were found. Continue if none were found.
| 2027 | RET NC
| 2028 | CALL STR_ALTER | Next consider if the stream is to be changed.
| 202B | RET NC | Continue unless it was altered.
The print item must now be an expression, either numeric or string.
| 202C | CALL SCANNING | Evaluate the expression but return now if checking syntax.
| 202F | CALL UNSTACK_Z
| 2032 | BIT 6,(IY+$01) | Test for the nature of the expression (bit 6 of FLAGS).
| 2036 | CALL Z,STK_FETCH | If it is a string then fetch the necessary parameters; but if it is numeric then exit via PRINT_FP.
| 2039 | JP NZ,PRINT_FP
A loop is now set up to deal with each character in turn of the string.
PR_STRING | 203C | LD A,B | Return now if there are no characters remaining in the string; otherwise decrease the counter.
| 203D | OR C
| 203E | DEC BC
| 203F | RET Z
| 2040 | LD A,(DE) | Fetch the code and increment the pointer.
| 2041 | INC DE
| 2042 | RST $10 | The code is printed and a jump taken to consider any further characters.
| 2043 | JR PR_STRING