From e58b96cacf0cea9426f602fd56f540fbc64bd96f Mon Sep 17 00:00:00 2001 From: Jali Date: Mon, 8 Sep 2025 22:48:12 +0200 Subject: [PATCH] Add prototype of a file read subroutine --- src/SUDOKU.MID | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/src/SUDOKU.MID b/src/SUDOKU.MID index 75ff132..688157d 100644 --- a/src/SUDOKU.MID +++ b/src/SUDOKU.MID @@ -102,9 +102,16 @@ PUTLN: PUSHJ P,OUTSTR ;Calls the OUTSTR subroutine .IOT CHTTYO,[^J] ;and a new line POPJ P, ;before returning. +;Subroutine that reads the contents of the file into the buffer at FIELD IMPRTF: PUSH P,A ;Save the A register. - .OPEN CHDSKI,[.UOA,,] - + .CALL [SETZ ? SIXBIT/OPEN/ [.UAI,,CHDSKI] ? FNAME1 ? FNAME2 ((SETZ))] + .LOSE %LSFIL ;Handle errors after opening the file + .CALL [SETZ ? SIXBIT/SIOT/ [,,CHDSKI] ? [BPTR,,FIELD] ? [,,33] ((SETZ))] + .LOSE %LSFIL + .CALL [SETZ ? SIXBIT/CLOSE/ [,,CHDSKI] ((SETZ))] + .LOSE %LSFIL + POP A ;Restore the A register. + POPJ P ;Return from the input subroutine, DONE: .LOGOUT 2, ;Exit point for the program. WELCOME:ASCIZ /SUDOKU SOLVER v0.1/ ;Text of the welcome banner. LOADING:ASCIZ /LOADING / ;Load message.