.ORG $300 INBUF = $200 ;GETLN input buffer. WAIT = $FCA8 ;Monitor wait routine. BELL = $FF3A ;Monitor bell routine. EXTRNCMD = $BE06 ;External cmd JMP vector. XTRNADDR = $BE50 ;Ext cmd implementation addr. XLEN = $BE52 ;length of command string-1. XCNUM = $BE53 ;CI cmd no. (ext cmd - 0). PBITS = $BE54 ;Command parameter bits. XRETURN = $BE9E ;Known RTS instruction. InputByte = $c0fe OutputByte = $c0fd InputFlags = $c0fb OutputFlags = $c0f7 ReadBlockCommand = $01 WriteBlockCommand = $02 GetTimeCommand = $03 ChangeDriveCommand = $04 ExecCommand = $05 LoadFileCommand = $06 SaveFileCommand = $07 MenuCommand = $08 InputString = $fd67 PrintChar = $fded Keyboard = $c000 ClearKeyboard = $c010 Wait = $fca8 ; ; FIRST SAVE THE EXTERNAL COMMAND ADDRESS SO YOU WON'T ; DISCONNECT ANY PREVIOUSLY CONNECTED COMMAND. ; LDA EXTRNCMD+1 STA NXTCMD LDA EXTRNCMD+2 STA NXTCMD+1 ; LDA #RPI ; external command JMP STA EXTRNCMD+2 ; vector. RTS ; RPI: LDX #0 ;Check for our command. NXTCHR: LDA INBUF,X ;Get first character. ora #$20 ;Make it lower case CMP CMD,X ;Does it match? BNE NOTOURS ;No, back to CI. INX ;Next character CPX #CMDLEN ;All characters yet? BNE NXTCHR ;No, read next one. ; LDA #CMDLEN-1 ;Our cmd! Put cmd length-1 STA XLEN ; in CI global XLEN. LDA #>XRETURN ;Point XTRNADDR to a known STA XTRNADDR ; RTS since we'll handle LDA #