Make sure to store SIXBIT in six-bit-wide bytes
This commit is contained in:
18
src/sudoku.s
18
src/sudoku.s
@@ -12,7 +12,6 @@ P=17 ;Define P as the stack pointer.
|
|||||||
|
|
||||||
PDLLEN==30 ;Set the size of the stack to 30 words.
|
PDLLEN==30 ;Set the size of the stack to 30 words.
|
||||||
PDL: BLOCK PDLLEN ;Reserve the stack memory
|
PDL: BLOCK PDLLEN ;Reserve the stack memory
|
||||||
BPTR==440700 ;Define a byte pointer, easier to write...
|
|
||||||
|
|
||||||
CHTTYO==1 ;Define a channel for TTY output.
|
CHTTYO==1 ;Define a channel for TTY output.
|
||||||
CHDSKI==2 ;Read channel for disk input.
|
CHDSKI==2 ;Read channel for disk input.
|
||||||
@@ -34,16 +33,16 @@ START: MOVE P,[-PDLLEN,,PDL-1] ;Initialize the stack.
|
|||||||
.LOSE %LSFIL ;Gobble up any errors.
|
.LOSE %LSFIL ;Gobble up any errors.
|
||||||
MOVEI A,000 ;Initialize the print flag
|
MOVEI A,000 ;Initialize the print flag
|
||||||
MOVEM A,PFLAGS ;to print ASCII
|
MOVEM A,PFLAGS ;to print ASCII
|
||||||
MOVE A,[BPTR,,WELCOME] ;Print the welcome message
|
MOVE A,[440700,,WELCOME] ;Print the welcome message
|
||||||
PUSHJ P,PUTLN
|
PUSHJ P,PUTLN
|
||||||
PUSHJ P,GETJCL ;Read the command line.
|
PUSHJ P,GETJCL ;Read the command line.
|
||||||
MOVE A,[BPTR,,LOADING] ;Print the loading message
|
MOVE A,[440700,,LOADING] ;Print the loading message
|
||||||
PUSHJ P,OUTSTR
|
PUSHJ P,OUTSTR
|
||||||
MOVEI A,001 ;Pretend the field name is SIXBIT
|
MOVEI A,001 ;Pretend the field name is SIXBIT
|
||||||
MOVEM A,PFLAGS ;Store flags in PFLAGS
|
MOVEM A,PFLAGS ;Store flags in PFLAGS
|
||||||
MOVE A,[BPTR,,FNAME1] ;Load FNAME1 into the A
|
MOVE A,[440600,,FNAME1] ;Load FNAME1 into the A
|
||||||
PUSHJ P,OUTSTR ;Print the name in a single line
|
PUSHJ P,OUTSTR ;Print the name in a single line
|
||||||
MOVE A,[BPTR,,FNAME2] ;Now repeat with FNAME2
|
MOVE A,[440600,,FNAME2] ;Now repeat with FNAME2
|
||||||
PUSHJ P,PUTLN
|
PUSHJ P,PUTLN
|
||||||
; Load the files into field
|
; Load the files into field
|
||||||
MOVEI A,FIELD ;Store the address of field in C
|
MOVEI A,FIELD ;Store the address of field in C
|
||||||
@@ -60,11 +59,10 @@ GETJCL: PUSH P,A ;Save the register A.
|
|||||||
MOVE A,[JCL,,JCL+30]
|
MOVE A,[JCL,,JCL+30]
|
||||||
BLT A,JCL+30
|
BLT A,JCL+30
|
||||||
.BREAK 12,[..RJCL,,JCL] ;Request the JCL.
|
.BREAK 12,[..RJCL,,JCL] ;Request the JCL.
|
||||||
MOVE A,[JCL]
|
MOVE A,[440700,,JCL] ;Load the command parameters into A.
|
||||||
MOVE A,[BPTR,,JCL] ;Load the command parameters into A.
|
MOVE B,[440600,,FNAME1] ;Pointer to the first file name.
|
||||||
MOVE B,[BPTR,,FNAME1] ;Pointer to the first file name.
|
|
||||||
PUSHJ P,TOSIXB ;Transfer the first word into FNAME1
|
PUSHJ P,TOSIXB ;Transfer the first word into FNAME1
|
||||||
MOVE B,[BPTR,,FNAME2] ;Pointer to the second file name.
|
MOVE B,[440600,,FNAME2] ;Pointer to the second file name.
|
||||||
PUSHJ P,TOSIXB ;Transfer the second word into FNAME2
|
PUSHJ P,TOSIXB ;Transfer the second word into FNAME2
|
||||||
POP P,B ;Restore the B register.
|
POP P,B ;Restore the B register.
|
||||||
POP P,A ;Restore the A register.
|
POP P,A ;Restore the A register.
|
||||||
@@ -159,7 +157,7 @@ IMPRTF: PUSH P,A ;Save the A 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
|
||||||
FNAME1 ? 400000,,FNAME2]
|
%CLIN,,FNAME1 ? 400000,,FNAME2]
|
||||||
.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.
|
||||||
|
|||||||
Reference in New Issue
Block a user