diff --git a/src/sudoku.s b/src/sudoku.s index eb33d79..5990c9e 100644 --- a/src/sudoku.s +++ b/src/sudoku.s @@ -17,8 +17,8 @@ CHTTYO==1 ;Define a channel for TTY output. CHDSKI==2 ;Read channel for disk input. JCL: BLOCK 30 ;Reserve space for the command line. -FNAME1: BLOCK 15 ;The first part of the file name. -FNAME2: BLOCK 15 ;The second file name. +FNAME1: BLOCK 1 ;The first part of the file name. +FNAME2: BLOCK 1 ;The second file name. FIELD: BLOCK 9 ;Reserve 9 words to store the grid. START: MOVE P,[-PDLLEN,,PDL-1] ;Initialize the stack. @@ -43,6 +43,8 @@ GETJCL: PUSH P,A ;Save the register A. SETZM JCL ;Zero out the JCL MOVE A,[JCL,,JCL+30] BLT A,JCL+30 + SETZM FNAME1 ;Zero out FNAME1 + SETZM FNAME2 ;Zero out FNAME2 .BREAK 12,[..RJCL,,JCL] ;Request the JCL. MOVE A,[440700,,JCL] ;Load the command parameters into A. MOVE B,[440600,,FNAME1] ;Pointer to the first file name. @@ -72,14 +74,15 @@ TOSIXB: PUSH P,D ;Store the contents of register D. TOSLP: ILDB D,A ;Load the next character from A. JUMPE D,TOSEN ;Exit the loop, if charachter is null. CAIN D,40 ;If the character is a whitespace, - JUMPA TOSEN ;exit the loop. + JUMPA TOSEN ;exit the loop. + CAIN D,[^M] ;If the character is a carriage return + JUMPA TOSEN ;exit the loop. CAIL D,140 ;If the character is > 96, SUBI D,40 ;then cut it down, so it's in range. SUBI D,40 ;Convert 32..95 to 0..63 IDPB D,B ;Deposit the character in the destination. JRST TOSLP ;Repeat with next character. -TOSEN: IDPB D,[000] ;Make sure the last char is 0 - POP P,D ;Restore the D register. +TOSEN: POP P,D ;Restore the D register. POPJ P, ;Return from function. ;Subroutine to print a string of text on the output.