| Routines

359C: THE 'STRING CONCATENATION' OPERATION (offset +17)

The address of this routine is found in the table of addresses. It is called indirectly via fp_calc_2. This subroutine performs the binary operation 'A$+B$'. The parameters for these strings are fetched and the total length found. Sufficient room to hold both the strings is made available in the work space and the strings are copied over. The result of this subroutine is therefore to produce a temporary variable A$+B$ that resides in the work space.
strs_add | 359C | CALL STK_FETCH | The parameters of the second string are fetched and saved.
| 359F | PUSH DE
| 35A0 | PUSH BC
| 35A1 | CALL STK_FETCH | The parameters of the first string are fetched.
| 35A4 | POP HL | The lengths are now in HL and BC.
| 35A5 | PUSH HL
| 35A6 | PUSH DE | The parameters of the first string are saved.
| 35A7 | PUSH BC
| 35A8 | ADD HL,BC | The total length of the two strings is calculated and passed to BC.
| 35A9 | LD B,H
| 35AA | LD C,L
| 35AB | RST $30 | Sufficient room is made available.
| 35AC | CALL STK_STO | The parameters of the new string are passed to the calculator stack.
| 35AF | POP BC | The parameters of the first string are retrieved and the string copied to the work space as long as it is not a null string.
| 35B0 | POP HL
| 35B1 | LD A,B
| 35B2 | OR C
| 35B3 | JR Z,OTHER_STR
| 35B5 | LDIR
OTHER_STR | 35B7 | POP BC | Exactly the same procedure is followed for the second string thereby giving 'A$+B$'.
| 35B8 | POP HL
| 35B9 | LD A,B
| 35BA | OR C
| 35BB | JR Z,STK_PNTRS
| 35BD | LDIR
This routine continues into STK_PNTRS.