Make subroutine independent of fields
This commit is contained in:
@@ -39,12 +39,10 @@ START: MOVE P,[-PDLLEN,,PDL-1] ;Initialize the stack.
|
|||||||
PUSHJ P,GETJCL ;Read the command line.
|
PUSHJ P,GETJCL ;Read the command line.
|
||||||
MOVE A,[BPTR,,LOADING] ;Print the loading message
|
MOVE A,[BPTR,,LOADING] ;Print the loading message
|
||||||
PUSHJ P,OUTSTR
|
PUSHJ P,OUTSTR
|
||||||
MOVEI A,001 ;Swtich to SIXBIT
|
MOVEI A,FNAME1 ;Store the first file name in A
|
||||||
MOVEM A,PFLAGS ;Reset the print flag
|
MOVEI B,FNAME2 ;Store the second file name in B
|
||||||
MOVE A,[BPTR,,FNAME1] ;Read the parameter.
|
MOVEI C.FIELD ;Store the address of field in C
|
||||||
PUSHJ P,OUTSTR ;Print the file name
|
PUSHJ P,IMPRTF ;Load the file
|
||||||
MOVE A,[BPTR,,FNAME2] ;Print the second file name.
|
|
||||||
PUSHJ P,PUTLN
|
|
||||||
|
|
||||||
JRST DONE ;Jump to the end of the program.
|
JRST DONE ;Jump to the end of the program.
|
||||||
|
|
||||||
@@ -103,14 +101,12 @@ PUTLN: PUSHJ P,OUTSTR ;Calls the OUTSTR subroutine
|
|||||||
POPJ P, ;before returning.
|
POPJ P, ;before returning.
|
||||||
|
|
||||||
;Subroutine that reads the contents of the file into the buffer at FIELD
|
;Subroutine that reads the contents of the file into the buffer at FIELD
|
||||||
IMPRTF: PUSH P,A ;Save the A register.
|
IMPRTF: .CALL [SETZ ? SIXBIT/OPEN/ [.UAI,,CHDSKI] ? A ? B ((SETZ))]
|
||||||
.CALL [SETZ ? SIXBIT/OPEN/ [.UAI,,CHDSKI] ? FNAME1 ? FNAME2 ((SETZ))]
|
|
||||||
.LOSE %LSFIL ;Handle errors after opening the file
|
.LOSE %LSFIL ;Handle errors after opening the file
|
||||||
.CALL [SETZ ? SIXBIT/SIOT/ [,,CHDSKI] ? [BPTR,,FIELD] ? [,,33] ((SETZ))]
|
.CALL [SETZ ? SIXBIT/SIOT/ [,,CHDSKI] ? [BPTR,,C] ? [,,33] ((SETZ))]
|
||||||
.LOSE %LSFIL
|
.LOSE %LSFIL
|
||||||
.CALL [SETZ ? SIXBIT/CLOSE/ [,,CHDSKI] ((SETZ))]
|
.CALL [SETZ ? SIXBIT/CLOSE/ [,,CHDSKI] ((SETZ))]
|
||||||
.LOSE %LSFIL
|
.LOSE %LSFIL
|
||||||
POP A ;Restore the A register.
|
|
||||||
POPJ P ;Return from the input subroutine,
|
POPJ P ;Return from the input subroutine,
|
||||||
DONE: .LOGOUT 2, ;Exit point for the program.
|
DONE: .LOGOUT 2, ;Exit point for the program.
|
||||||
WELCOME:ASCIZ /SUDOKU SOLVER v0.1/ ;Text of the welcome banner.
|
WELCOME:ASCIZ /SUDOKU SOLVER v0.1/ ;Text of the welcome banner.
|
||||||
|
|||||||
Reference in New Issue
Block a user