XTAL BASIC Extra
by David Elliott
Here are six more commands tor Crystal Basic 2.2. OLD recovers a program
which has been ‘exterminated’ by a NEW or a cold start. STRING$(nn,cc) creates a
string of nn characters with ASCII code cc. LOWER$(..) and UPPER$(..) convert a
given string to lower and upper case respectively, while REVERSE$(..) changes the
case of the characters in a string. Finally, EVAL(…) returns the value of a given
string. The assembler listing of the commands is followed by the code to be entered
using the
loader program
described in the last issue.
2D00 | | 0090 | | ORG £2D00 | |
| | 0100 | ; |
| | 0110 | ; @@@@@@@@@@@ |
| | 0120 | ; @@ O L D @@ |
| | 0130 | ; @@@@@@@@@@@ |
| | 0140 | ; |
| | 0150 | ; OLD RECOVERS A PROGRAM PREVIOUSLY |
| | 0160 | ; ERASED BY A ‘NEW’ COMMAND |
| | 0170 | ; |
2D00 | FD2A8312 | 0180 | OLD | LD IY, (1283H) | ; GET TEXT START |
2D04 | FDE5 | 0190 | | PUSH IY | ; SET IX TO START |
2D06 | DDE1 | 0200 | | POP IX | |
2D08 | AF | 0210 | | XOR A | |
2D09 | 0600 | 0220 | | LD B, 0 | ; DOING FIRST LINE |
2D0B | 110400 | 0230 | | LD DE, 4 | ; SKIP LINE NUMBER |
2D0E | FD19 | 0240 | | ADD IY, DE | ; AND LINK ADDRESS |
2D10 | FDBE00 | 0250 | OLD1 | CP (IY) | ; END OF LINE? |
2D13 | 2804 | 0260 | | JR Z, OLD3 | ; IF SO, JUMP |
2D15 | FD23 | 0270 | OLD2 | INC IY | ; NO, TRY NEXT BYTE |
2D17 | 18F7 | 0280 | | JR OLD1 | |
| | 0290 | ; |
2D19 | 78 | 0300 | OLD3 | LD A,B | ; END OF 1ST LINE? |
2D1A | B7 | 0310 | | OR A | |
2D1B | 200D | 0320 | | JR NZ, OLD4 | |
2D1D | 0601 | 0330 | | LD B,1 | ; IF SO, RESET FLAG |
2D1F | FD23 | 0340 | | INC IY | ; RESTORE LINK |
2D21 | FDE5 | 0350 | | PUSH IY | ; TO SECOND LINE |
2D23 | D1 | 0360 | | POP DE | |
2D24 | DD7300 | 0370 | | LD (IX),E | |
2D27 | DD7201 | 0380 | | LD (IX+1),D | |
| | 0390 | ; |
2D2A | AF | 0400 | OLD4 | XOR A | |
2D2B | FDBE01 | 0410 | | CP (IY+1) | ; END OF PROGRAM? |
2D2E | 20E5 | 0420 | | JR NZ,OLD2 | ; NO, TRY AGAIN |
2D30 | FDBE02 | 0430 | | CP (IY+2) | ; END OF PROGRAM? |
2D33 | 20E0 | 0440 | | JR NZ, OLD2 | ; NO, TRY AGAIN |
| | 0450 | ; |
| | 0460 | ; END OF PROGRAM FOUND |
| | 0470 | ; |
2D35 | 110300 | 0480 | | LD DE, 3 | ; RESTORE POINTERS |
2D38 | FD19 | 0490 | | ADD IY, DE | |