| Routines

13893: THE 'READ-IN' SUBROUTINE (offset 26)

The address of this routine is found in the table of addresses. It is called indirectly via fp_calc_2. This subroutine is called via the calculator offset (90) through the first line of S_INKEY. It appears to provide for the reading in of data through different streams from those available on the standard Spectrum. Like S_INKEY the subroutine returns a string.
read_in | 13893 | CALL FIND_INT1 | The numerical parameter is compressed into the A register.
| 13896 | CP 16 | Is it smaller than 16?
| 13898 | JP NC,REPORT_B_2 | If not, report the error.
| 13901 | LD HL,(23633) | The current channel address (CURCHL) is saved on the machine stack.
| 13904 | PUSH HL
| 13905 | CALL CHAN_OPEN | The channel specified by the parameter is opened.
| 13908 | CALL INPUT_AD | The signal is now accepted, like a 'key-value'.
| 13911 | LD BC,0 | The default length of the resulting string is zero.
| 13914 | JR NC,R_I_STORE | Jump if there was no signal.
| 13916 | INC C | Set the length to 1 now.
| 13917 | RST 48 | Make a space in the work space.
| 13918 | LD (DE),A | Put the string into it.
R_I_STORE | 13919 | CALL STK_STO | Pass the parameters of the string to the calculator stack.
| 13922 | POP HL | Restore CURCHL and the appropriate flags.
| 13923 | CALL CHAN_FLAG
| 13926 | JP STK_PNTRS | Exit, setting the pointers.