![]() |
Routines |
| Prev: 35DE | Up: Map | Next: 3645 |
|
The address of this routine is found in the table of addresses. It is called indirectly via fp_calc_2.
This subroutine handles the function STR$ X and returns a 'last value' which is a set of parameters that define a string containing what would appear on the screen if X were displayed by a PRINT command.
|
||||
| str | 361F | LD BC,$0001 | One space is made in the work space and its address is copied to K-CUR, the address of the cursor. | |
| 3622 | RST $30 | |||
| 3623 | LD ($5C5B),HL | |||
| 3626 | PUSH HL | This address is saved on the stack too. | ||
| 3627 | LD HL,($5C51) | The current channel address (CURCHL) is saved on the machine stack. | ||
| 362A | PUSH HL | |||
| 362B | LD A,$FF | Channel 'R' is opened, allowing the string to be 'printed' out into the work space. | ||
| 362D | CALL CHAN_OPEN | |||
| 3630 | CALL PRINT_FP | The 'last value', X, is now printed out in the work space and the work space is expanded with each character. | ||
| 3633 | POP HL | Restore CURCHL to HL and restore the flags that are appropriate to it. | ||
| 3634 | CALL CHAN_FLAG | |||
| 3637 | POP DE | Restore the start address of the string. | ||
| 3638 | LD HL,($5C5B) | Now the cursor address is one past the end of the string and hence the difference is the length. | ||
| 363B | AND A | |||
| 363C | SBC HL,DE | |||
| 363E | LD B,H | Transfer the length to BC. | ||
| 363F | LD C,L | |||
| 3640 | CALL STK_STO | Pass the parameters of the new string to the calculator stack. | ||
| 3643 | EX DE,HL | Reset the pointers. | ||
| 3644 | RET | Finished. | ||
|
Note: see PRINT_FP for an explanation of the 'PRINT "A"+STR$ 0.1' error.
|
||||
| Prev: 35DE | Up: Map | Next: 3645 |