Micro­power

  

Volume 1 · Number 4 · December 1981

Page 12 of 33

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;
4E000140ORG £4E00; EXECUTION ADDRESS
4E00EF0150LOADRRST 40; PRINT STRING
4E010C0160DEFB 12; CLEAR STRING
4E02456E74650170DEFM "ENTER COMMAND/​FUNCTION NAME"
4E1E0D000180DEFB 13,0; CRLF, END OF STRING
4E20DF630190SCAL INLIN; INPUT LINE
4E221A0200LD A, (DE); GET 1ST CHARACTER
4E23FE200210CP ' '; NAME ENTERED?
4E2528320220JR Z,NOTCOM; JUMP IF NOT
4E2721800E0230LD HL, NAMES; SET POINTER
4E2A0EFF0240LD C,-1; RESET COUNTER
4E2C7E0250LOOPLD A (HL); GET NEXT BYTE
4E2DCB7F0260BIT 7,A; STARTOFWORD?
4E2F28050270JR Z,NEXT; IF NOT, TRY NEXT
4E310C0280INC C; INCREMENT COUNTER
4E32FE800290CP £80; END OF TABLE?
4E3428030300JR Z,ADDNAM; ADD TO TABLE
4E36230310NEXTINC HL; INCREMENT POINTER
4E3718F30320JR LOOP; NEXT CHARACTER
4E391A0330ADDNAMLD A (DE); GET NEXT BYTE
4E3ACBFF0340SET 7,A; SET BIT 7
4E3C770350LD (HL),A; SAVE 1ST CHAR.
4E3D230360ADD1INC HL; INCR. POINTERS
4E3E130370INC DE
4E3F1A0380LD A,(DE); GET CHARACTER
4E40FE200390CP ' '; END OF NAME?
4E4228030400JR Z,ADD80; IF SO, INSERT £80
4E44770410LD (HL),A; SAVE CHARACTER
4E4518F60420JR ADD1; CONTINUE
4E4736800430ADD80LD (HL), £80; ADD DELIMITER
4E49590440LD E,C; CALCULATE ADDRESS
4E4A16000450LD D,0; OF VECTOR
4E4CEB0460EX DE,HL
4E4D290470ADD HL,HL
4E4E11800F0480LD DE,VECT; START OF TABLE
4E51190490ADD HL,DE
4E52ED5B83120500LD DE,(TEXT); SET VECTOR
4E56730510LD (HL),E; AT END OF BASIC
4E57230520INC HL
4E58720530LD (HL),D
4E59EF0540NCOMRST 40; PRINT STRING
4E5A456E74650550DEFM /ENTER MACHINE CODE./
4E6D0D000560DEFB 13,0; CRLF, STRING END
Page 12 of 33