From dfd415476da233ef9e82cf9bc66ef40a292a15a5 Mon Sep 17 00:00:00 2001 From: Jali Date: Tue, 2 Dec 2025 20:57:08 +0100 Subject: [PATCH] Reactivate import function --- src/sudoku.s | 15 +++++++-------- 1 file changed, 7 insertions(+), 8 deletions(-) diff --git a/src/sudoku.s b/src/sudoku.s index d67ab54..9809b09 100644 --- a/src/sudoku.s +++ b/src/sudoku.s @@ -39,19 +39,18 @@ START: MOVE P,[-PDLLEN,,PDL-1] ;Initialize the stack. PUSHJ P,GETJCL ;Read the command line. MOVE A,[BPTR,,LOADING] ;Print the loading message PUSHJ P,OUTSTR - ; Hold off loading the file, and instead, try to figure out, if they - ; are stored as SIXBIT - ;MOVEI A,FIELD ;Store the address of field in C - ;PUSHJ P,IMPRTF ;Load the file - ;PUSHJ P,PFIELD ;Print the loaded field. - MOVEI A,001 ;Pretend the field name is SIXBIT MOVEM A,PFLAGS ;Store flags in PFLAGS MOVE A,[BPTR,,FNAME1] ;Load FNAME1 into the A PUSHJ P,OUTSTR ;Print the name in a single line MOVE A,[BPTR,,FNAME2] ;Now repeat with FNAME2 PUSHJ P,PUTLN - + ; Load the files into field + MOVEI A,FIELD ;Store the address of field in C + PUSHJ P,IMPRTF ;Load the file + PUSHJ P,PFIELD ;Print the loaded field. + + JRST DONE ;Jump to the end of the program. ;Subroutine to read the JCL from DDT and get the command line parameters. @@ -147,7 +146,7 @@ IMPRTF: PUSH P,A ;Save the A register. MOVE X,[440400,,FIELD] ;Init a 4-bit byte pointer to FIELD. .CALL [SETZ ? SIXBIT/OPEN/ ;Open a file descriptor. [.UAI,,CHDSKI] ? [SIXBIT/DSK/] ;Mode, channel and device name - ? FNAME1 ? FNAME2 ((SETZ))] + FNAME1 ? FNAME2 ((SETZ))] .LOSE %LSFIL ;Handle errors after opening the file IMPRD: .IOT CHDSKI,A ;Read an ascii char into A. JUMPL A,IMPREX ;If there was nothing read, exit.