Adjust the file parameters in IMPRTF

This commit is contained in:
2025-10-28 23:20:15 +01:00
parent d06a0cdf50
commit ad6331a93d

View File

@@ -134,11 +134,12 @@ PFIEEX: POP P,Y ;Restore the Y register.
;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: PUSH P,A ;Save the A register.
PUSH P,B ;Save the B register.
PUSH P,X ;Save the index register. PUSH P,X ;Save the index register.
MOVE X,[440400,,FIELD] ;Init a 4-bit byte pointer to FIELD. MOVE X,[440400,,FIELD] ;Init a 4-bit byte pointer to FIELD.
.CALL [SETZ ? SIXBIT/OPEN/ ;Open a file descriptor. .CALL [SETZ ? SIXBIT/OPEN/ ;Open a file descriptor.
[.UAI,,CHDSKI] ? [SIXBIT/DSK/] ;Mode, channel and device name [.UAI,,CHDSKI] ? [SIXBIT/DSK/] ;Mode, channel and device name
[SIXBIT /PUZZL1/] ? [SIXBIT /SUDOKU/] ? 400000,,[SIXBIT/JALI/]] [%CLIN,,A] ? [%CLIN,,B] ? ((SETZ))]
.LOSE %LSFIL ;Handle errors after opening the file .LOSE %LSFIL ;Handle errors after opening the file
IMPRD: .IOT CHDSKI,A ;Read an ascii char into A. IMPRD: .IOT CHDSKI,A ;Read an ascii char into A.
JUMPL A,IMPREX ;If there was nothing read, exit. JUMPL A,IMPREX ;If there was nothing read, exit.
@@ -153,6 +154,7 @@ IMPREX: .CALL [SETZ ? SIXBIT/CLOSE/ ;Close the file, before returning.
[,,CHDSKI] ((SETZ))] [,,CHDSKI] ((SETZ))]
.LOSE %LSFIL .LOSE %LSFIL
POP P,X ;Restore the X register. POP P,X ;Restore the X register.
POP P,B ;Restore the B register
POP P,A ;Restore the A register. POP P,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.