Reinstated *DIR error handling if no parm

This commit is contained in:
Bobbi Webber-Manners 2021-09-02 18:18:50 -04:00
parent e66c0bea4c
commit b7abbf1399
2 changed files with 9 additions and 1 deletions

Binary file not shown.

View File

@ -709,7 +709,13 @@ RENRET
* Handle *DIR (directory change) command
* On entry, XY points to command line
CHDIR JSR PARSNAME ; Copy filename->MOSFILE
>>> XF2MAIN,SETPFX
CMP #$00 ; Filename length
BNE :HASPARM
BRK
DB $DC
ASC 'Syntax: DIR <pathname>'
BRK
:HASPARM >>> XF2MAIN,SETPFX
CHDIRRET
>>> ENTAUX
JSR CHKERROR
@ -723,6 +729,7 @@ CHDIRRET
* Parse filename pointed to by XY
* Write filename to MOSFILE in main memory
* Returns length in A
PARSNAME JSR XYtoLPTR
CLC ; Means parsing a filename
JSR GSINIT ; Init gen string handling
@ -740,6 +747,7 @@ PARSNAME JSR XYtoLPTR
STX MOSFILE ; Length byte (Pascal)
STA $C005 ; Back to aux
PLP ; IRQs back as they were
TXA ; Return len in A
RTS
* Move this somewhere