TOSIXB: Add a test for JCL ending in <CR>
This commit is contained in:
13
src/sudoku.s
13
src/sudoku.s
@@ -17,8 +17,8 @@ CHTTYO==1 ;Define a channel for TTY output.
|
|||||||
CHDSKI==2 ;Read channel for disk input.
|
CHDSKI==2 ;Read channel for disk input.
|
||||||
|
|
||||||
JCL: BLOCK 30 ;Reserve space for the command line.
|
JCL: BLOCK 30 ;Reserve space for the command line.
|
||||||
FNAME1: BLOCK 15 ;The first part of the file name.
|
FNAME1: BLOCK 1 ;The first part of the file name.
|
||||||
FNAME2: BLOCK 15 ;The second file name.
|
FNAME2: BLOCK 1 ;The second file name.
|
||||||
FIELD: BLOCK 9 ;Reserve 9 words to store the grid.
|
FIELD: BLOCK 9 ;Reserve 9 words to store the grid.
|
||||||
|
|
||||||
START: MOVE P,[-PDLLEN,,PDL-1] ;Initialize the stack.
|
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
|
SETZM JCL ;Zero out the JCL
|
||||||
MOVE A,[JCL,,JCL+30]
|
MOVE A,[JCL,,JCL+30]
|
||||||
BLT A,JCL+30
|
BLT A,JCL+30
|
||||||
|
SETZM FNAME1 ;Zero out FNAME1
|
||||||
|
SETZM FNAME2 ;Zero out FNAME2
|
||||||
.BREAK 12,[..RJCL,,JCL] ;Request the JCL.
|
.BREAK 12,[..RJCL,,JCL] ;Request the JCL.
|
||||||
MOVE A,[440700,,JCL] ;Load the command parameters into A.
|
MOVE A,[440700,,JCL] ;Load the command parameters into A.
|
||||||
MOVE B,[440600,,FNAME1] ;Pointer to the first file name.
|
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.
|
TOSLP: ILDB D,A ;Load the next character from A.
|
||||||
JUMPE D,TOSEN ;Exit the loop, if charachter is null.
|
JUMPE D,TOSEN ;Exit the loop, if charachter is null.
|
||||||
CAIN D,40 ;If the character is a whitespace,
|
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,
|
CAIL D,140 ;If the character is > 96,
|
||||||
SUBI D,40 ;then cut it down, so it's in range.
|
SUBI D,40 ;then cut it down, so it's in range.
|
||||||
SUBI D,40 ;Convert 32..95 to 0..63
|
SUBI D,40 ;Convert 32..95 to 0..63
|
||||||
IDPB D,B ;Deposit the character in the destination.
|
IDPB D,B ;Deposit the character in the destination.
|
||||||
JRST TOSLP ;Repeat with next character.
|
JRST TOSLP ;Repeat with next character.
|
||||||
TOSEN: IDPB D,[000] ;Make sure the last char is 0
|
TOSEN: POP P,D ;Restore the D register.
|
||||||
POP P,D ;Restore the D register.
|
|
||||||
POPJ P, ;Return from function.
|
POPJ P, ;Return from function.
|
||||||
|
|
||||||
;Subroutine to print a string of text on the output.
|
;Subroutine to print a string of text on the output.
|
||||||
|
|||||||
Reference in New Issue
Block a user