When the machine code routine is complete a full stop is entered. The loader
then asks if another command is to be entered. If the response is ‘Y’, the program
continues, adding the next command immediately after the last. Otherwise it changes
the Basic Text Pointer (at 1283H) to the start of the next 256-byte page. In Xtal Basic
the text must start on a page boundary.
| | 0090 | ; |
| | 0100 | ; *********************************************** |
| | 0110 | ; ** COMMAND LOADER BY D. ELLIOT ** |
| | 0120 | ; *********************************************** |
| | 0130 | ; |
4E00 | | 0140 | | ORG £4E00 | ; EXECUTION ADDRESS |
4E00 | EF | 0150 | LOADR | RST 40 | ; PRINT STRING |
4E01 | 0C | 0160 | | DEFB 12 | ; CLEAR STRING |
4E02 | 456E7465 | 0170 | | DEFM "ENTER COMMAND/FUNCTION NAME" |
4E1E | 0D00 | 0180 | | DEFB 13,0 | ; CRLF, END OF STRING |
4E20 | DF63 | 0190 | | SCAL INLIN | ; INPUT LINE |
4E22 | 1A | 0200 | | LD A, (DE) | ; GET 1ST CHARACTER |
4E23 | FE20 | 0210 | | CP ' ' | ; NAME ENTERED? |
4E25 | 2832 | 0220 | | JR Z,NOTCOM | ; JUMP IF NOT |
4E27 | 21800E | 0230 | | LD HL, NAMES | ; SET POINTER |
4E2A | 0EFF | 0240 | | LD C,-1 | ; RESET COUNTER |
4E2C | 7E | 0250 | LOOP | LD A (HL) | ; GET NEXT BYTE |
4E2D | CB7F | 0260 | | BIT 7,A | ; STARTOFWORD? |
4E2F | 2805 | 0270 | | JR Z,NEXT | ; IF NOT, TRY NEXT |
4E31 | 0C | 0280 | | INC C | ; INCREMENT COUNTER |
4E32 | FE80 | 0290 | | CP £80 | ; END OF TABLE? |
4E34 | 2803 | 0300 | | JR Z,ADDNAM | ; ADD TO TABLE |
4E36 | 23 | 0310 | NEXT | INC HL | ; INCREMENT POINTER |
4E37 | 18F3 | 0320 | | JR LOOP | ; NEXT CHARACTER |
4E39 | 1A | 0330 | ADDNAM | LD A (DE) | ; GET NEXT BYTE |
4E3A | CBFF | 0340 | | SET 7,A | ; SET BIT 7 |
4E3C | 77 | 0350 | | LD (HL),A | ; SAVE 1ST CHAR. |
4E3D | 23 | 0360 | ADD1 | INC HL | ; INCR. POINTERS |
4E3E | 13 | 0370 | | INC DE | |
4E3F | 1A | 0380 | | LD A,(DE) | ; GET CHARACTER |
4E40 | FE20 | 0390 | | CP ' ' | ; END OF NAME? |
4E42 | 2803 | 0400 | | JR Z,ADD80 | ; IF SO, INSERT £80 |
4E44 | 77 | 0410 | | LD (HL),A | ; SAVE CHARACTER |
4E45 | 18F6 | 0420 | | JR ADD1 | ; CONTINUE |
4E47 | 3680 | 0430 | ADD80 | LD (HL), £80 | ; ADD DELIMITER |
4E49 | 59 | 0440 | | LD E,C | ; CALCULATE ADDRESS |
4E4A | 1600 | 0450 | | LD D,0 | ; OF VECTOR |
4E4C | EB | 0460 | | EX DE,HL | |
4E4D | 29 | 0470 | | ADD HL,HL | |
4E4E | 11800F | 0480 | | LD DE,VECT | ; START OF TABLE |
4E51 | 19 | 0490 | | ADD HL,DE | |
4E52 | ED5B8312 | 0500 | | LD DE,(TEXT) | ; SET VECTOR |
4E56 | 73 | 0510 | | LD (HL),E | ; AT END OF BASIC |
4E57 | 23 | 0520 | | INC HL | |
4E58 | 72 | 0530 | | LD (HL),D | |
4E59 | EF | 0540 | NCOM | RST 40 | ; PRINT STRING |
4E5A | 456E7465 | 0550 | | DEFM /ENTER MACHINE CODE./ |
4E6D | 0D00 | 0560 | | DEFB 13,0 | ; CRLF, STRING END |