NEW AUTO 3,1 * object code = sel_0 * * dispatcher 1 - this code org's and operates at 'dispadr' (=$1000) but * is resident in memory at 'displc2' (=$D100) in the alternate 4k bank * of the language card. the quit call vectors to a routine high in the * mli that moves dispatcher 1 down and jumps to it. the move routine * must remain somewhere between $E000-$F7FF. this routine must be less * than 3 pages in length. ofsS .EQ disp1obj-dispadr offset to dispatcher org disp1obj lda romin read ROM sta clr80vid disable 80 col hardware sta clraltchar normal LC, flashing UC sta store80off disable 80 column store jsr setnorm set normal text mode jsr init init text screen jsr setvid reset output to screen jsr setkbd reset input to keyboard ldx #$17 clear the memory bitmap lda #$01 but protect page $BF00. sta memmap,x P8 memory bitmap dex lda #$00 L5A22 sta memmap,x dex bpl L5A22 lda #$CF protect zero page, stack and sta memmap $400-$7FF (text screen display) L5A2D jsr home clear screen jsr crout position top/left ldx # $88 then char may be acceptable. L5B09 jsr bell output bell (ctl-G) jmp loop1 not good. L5B0F cmp #$8D cr ? beq L5B3C then done. cmp #$DB less than 'Z' ? bcc L5B19 no. and #$DF make sure it's uppercase. L5B19 cmp #$AE '.' ? bcc L5B09 not good if less. cmp #$DB less than '[' ? bcs L5B09 not good. cmp #$BA <= '9' ? bcc L5B29 then ok. cmp #$C1 greater than 'A' ? bcc L5B09 if not, then no good. L5B29 pha it's good, save it. jsr clreol clear to end of line pla jsr cout print it inx cpx #$27 more than 39 chars ? bcs L5AF6 too long, get pathname again. sta PrefixBuf,x store it. jmp loop1 get another char L5B3C lda #$A0 jsr cout after cr, blank out the cursor. stx PrefixBuf put length in front of the name. jsr MLI get file info for pathname in PrefixBuf .DA #$C4' .DA dsp1info' bcc L5B4F if no errors. jmp dsp1error L5B4F lda dsp1type cmp #$FF is it a SYS file ? beq L5B5B yes. lda #$01 not SYS file error. jmp dsp1error L5B5B lda #$00 it's a system file sta dsp1cln jsr MLI close all open files .DA #$CC' .DA dsp1cls' bcc L5B6B jmp dsp1error L5B6B lda dsp1acess check for proper access. and #$01 is read disabled ? bne L5B77 no, access ok. lda #$27 i/o error jmp dsp1error L5B77 jsr MLI open the file .DA #$C8' .DA dsp1open' bcc L5B82 jmp dsp1error L5B82 lda dsp1refn copy the reference number sta dsp1rdn sta dsp1eofn jsr MLI get eof .DA #$D1' .DA dsp1eof' bcs L5BE2 lda dsp1eofb+2 3rd of 3 bytes. beq L5B9C if 0 then ok lda #$27 else i/o error because bne L5BE2 file is too large. L5B9C lda dsp1eofb move eof to # of bytes to read. sta dsp1cnt lda dsp1eofb+1 sta dsp1cnt+1 jsr MLI read the file .DA #$CA' .DA dsp1read' php save the status. jsr MLI close the file. .DA #$CC' .DA dsp1cls' bcc L5BBB L5BB7 plp get status (it is irrelevant now) bne L5BE2 if close generated an error plp here if close was ok. L5BBB bcs L5BB7 error. jmp sysentry execute system file delchar .EQ *-ofsS lda ch is cursor in column 0 ? beq L5BD3 yes, ignore it. dex lda #$A0 blank out the cursor jsr cout dec ch dec ch point to last char entered jsr cout and blank it too. dec ch point to that location. L5BD3 jmp loop1 get next char. prntmsg .EQ *-ofsS L5BD6 lda dsp1msgs,x beq L5BE1 jsr cout inx bne L5BD6 L5BE1 rts * dispatcher 1 error handler dsp1error .EQ *-ofsS L5BE2 sta errnum lda #$0C display error message on line 13 sta cv jsr crout lda errnum cmp #$01 bne L5BF5 ldx #