BillG wrote:
LUCIDATA made public some information about internal data structures located in page 1 of memory in a provided file RUNEQU.TXT which opens the possibility that a programmer may choose to peek or poke those locations using hard-coded addresses. Maybe I am being too obsessed about absolute compatibility with the 680x versions, but I am seriously tempted to try to keep these data items at the same addresses.
I am kind of disappointed about this. A look ahead to version 2.2 reveals that many of the internal data structures have changed significantly, meaning that there is not a safe (compatible) way to access them in order to make a program behave in a more civilized manner. If a program needs an input file and one is not specified, the result is a zombie-like situation in which it tries to get the information from the console, often requiring a reboot to get out.
Still, there is good news. The disassembler is working well; I put it up in my repo.
Then I took it further and made a version to embed the disassembled P-code into a listing from the compiler; it gives nice results. Unfortunately, it has to be a separate program with much duplicated code because I am not peeking into internal data structures.
The Easter sample program:
Code:
PASCAL P-COMPILER ( VERSION 1 ) : COPYRIGHT C 1978 D.R.GIBBY
0 PROGRAM EASTER ;
0 (* A PROGRAM TO CALCULATE THE DATE OF EASTER
0 IN EACH OF SEVERAL YEARS.
0 ADAPTED FROM A PROGRAM BY URS AMMAN
0 ( SOFTWARE PRACTICE + EXPERIENCE, VOL 7, NO 3, P 419 )
0 USING THE ALGORITHM GIVEN BY DONALD KNUTH
0 IN " THE ART OF COMPUTER PROGRAMMING " VOL 1 *)
0 CONST
0 LIM1 = 1978 ; LIM2 = 2000 ;
0 VAR
0 YEAR : INTEGER ;
0 FUNCTION MODFN (J,K:INTEGER):INTEGER;
4 BEGIN
4 MODFN:=J-(J DIV K) * K ;
36 END;
40 PROCEDURE DATEOFEASTER ( Y : INTEGER );
40 VAR
40 N,M,G,C,X,Z,D,E : INTEGER ;
40 BEGIN
44 G:=MODFN(Y,19)+1;
68 C:=Y DIV 100 +1;
84 X:=3*C DIV 4-12;
108 Z:=(8*C+5) DIV 25 -5;
136 D:=5*Y DIV 4-X-10;
168 E:=(11*G+20+Z-X);
204 E:=MODFN(E,30);
224 IF E<0 THEN E:=E+30;
248 IF (E<25) AND (G>11) OR (E=24) THEN E:=E+1;
304 N:=44-E;
320 IF N<21 THEN N:=N+30;
344 N:=N+7-MODFN(D+N,7);
384 IF N>31 THEN
396 BEGIN
396 N:=N-31;
408 M:=4;
416 END
416 ELSE M:=3;
428 WRITE(N);
436 IF M=3 THEN WRITE(" MARCH")
460 ELSE WRITE(" APRIL");
476 WRITELN(Y);
488 END; (* OF DATE OF EASTER *)
492 BEGIN
496 FOR YEAR:=LIM1 TO LIM2 DO
508 DATEOFEASTER(YEAR);
548 END.
Code:
Highest opcode used: $2E
Image length: $0228
Array subscript table:
0: 1..6
PASCAL P-COMPILER ( VERSION 1 ) : COPYRIGHT C 1978 D.R.GIBBY
0 PROGRAM EASTER ;
0 (* A PROGRAM TO CALCULATE THE DATE OF EASTER
0 IN EACH OF SEVERAL YEARS.
0 ADAPTED FROM A PROGRAM BY URS AMMAN
0 ( SOFTWARE PRACTICE + EXPERIENCE, VOL 7, NO 3, P 419 )
0 USING THE ALGORITHM GIVEN BY DONALD KNUTH
0 IN " THE ART OF COMPUTER PROGRAMMING " VOL 1 *)
0 CONST
0 LIM1 = 1978 ; LIM2 = 2000 ;
0 VAR
0 YEAR : INTEGER ;
0 FUNCTION MODFN (J,K:INTEGER):INTEGER;
0000: 01 00 01 EC ; Jump $01EC
4 BEGIN
4 MODFN:=J-(J DIV K) * K ;
0004: 26 00 00 08 ; Push integer at frame+$0008
0008: 26 00 00 08 ; Push integer at frame+$0008
000C: 26 00 00 0A ; Push integer at frame+$000A
0010: 2B 00 00 00 ; Divide integers
0014: 26 00 00 0A ; Push integer at frame+$000A
0018: 2A 00 00 00 ; Multiply integers
001C: 29 00 00 00 ; Subtract integers
0020: 27 00 00 00 ; Pop integer at frame+$0000
36 END;
0024: 05 00 00 00 ; Return
40 PROCEDURE DATEOFEASTER ( Y : INTEGER );
40 VAR
40 N,M,G,C,X,Z,D,E : INTEGER ;
40 BEGIN
0028: 06 00 00 10 ; SP := SP + $0010
44 G:=MODFN(Y,19)+1;
002C: 04 00 00 02 ; Reserve 2 bytes for return value
0030: 26 00 00 08 ; Push integer at frame+$0008
0034: 07 02 00 13 ; Push integer 19
0038: 03 01 00 04 ; Finish calling $0004
003C: 28 01 00 01 ; Add 1 to integer
0040: 27 00 00 0E ; Pop integer at frame+$000E
68 C:=Y DIV 100 +1;
0044: 26 00 00 08 ; Push integer at frame+$0008
0048: 2B 01 00 64 ; Divide 100 into integer
004C: 28 01 00 01 ; Add 1 to integer
0050: 27 00 00 10 ; Pop integer at frame+$0010
84 X:=3*C DIV 4-12;
0054: 07 02 00 03 ; Push integer 3
0058: 26 00 00 10 ; Push integer at frame+$0010
005C: 2A 00 00 00 ; Multiply integers
0060: 2B 01 00 04 ; Divide 4 into integer
0064: 29 01 00 0C ; Subtract 12 from integer
0068: 27 00 00 12 ; Pop integer at frame+$0012
108 Z:=(8*C+5) DIV 25 -5;
006C: 07 02 00 08 ; Push integer 8
0070: 26 00 00 10 ; Push integer at frame+$0010
0074: 2A 00 00 00 ; Multiply integers
0078: 28 01 00 05 ; Add 5 to integer
007C: 2B 01 00 19 ; Divide 25 into integer
0080: 29 01 00 05 ; Subtract 5 from integer
0084: 27 00 00 14 ; Pop integer at frame+$0014
136 D:=5*Y DIV 4-X-10;
0088: 07 02 00 05 ; Push integer 5
008C: 26 00 00 08 ; Push integer at frame+$0008
0090: 2A 00 00 00 ; Multiply integers
0094: 2B 01 00 04 ; Divide 4 into integer
0098: 26 00 00 12 ; Push integer at frame+$0012
009C: 29 00 00 00 ; Subtract integers
00A0: 29 01 00 0A ; Subtract 10 from integer
00A4: 27 00 00 16 ; Pop integer at frame+$0016
168 E:=(11*G+20+Z-X);
00A8: 07 02 00 0B ; Push integer 11
00AC: 26 00 00 0E ; Push integer at frame+$000E
00B0: 2A 00 00 00 ; Multiply integers
00B4: 28 01 00 14 ; Add 20 to integer
00B8: 26 00 00 14 ; Push integer at frame+$0014
00BC: 28 00 00 00 ; Add integers
00C0: 26 00 00 12 ; Push integer at frame+$0012
00C4: 29 00 00 00 ; Subtract integers
00C8: 27 00 00 18 ; Pop integer at frame+$0018
204 E:=MODFN(E,30);
00CC: 04 00 00 02 ; Reserve 2 bytes for return value
00D0: 26 00 00 18 ; Push integer at frame+$0018
00D4: 07 02 00 1E ; Push integer 30
00D8: 03 01 00 04 ; Finish calling $0004
00DC: 27 00 00 18 ; Pop integer at frame+$0018
224 IF E<0 THEN E:=E+30;
00E0: 26 00 00 18 ; Push integer at frame+$0018
00E4: 07 02 00 00 ; Push integer 0
00E8: 22 00 00 F8 ; Compare integers for <, if false then jump $00F8
00EC: 26 00 00 18 ; Push integer at frame+$0018
00F0: 28 01 00 1E ; Add 30 to integer
00F4: 27 00 00 18 ; Pop integer at frame+$0018
248 IF (E<25) AND (G>11) OR (E=24) THEN E:=E+1;
00F8: 26 00 00 18 ; Push integer at frame+$0018
00FC: 07 02 00 19 ; Push integer 25
0100: 22 00 00 00 ; Compare integers for <
0104: 26 00 00 0E ; Push integer at frame+$000E
0108: 07 02 00 0B ; Push integer 11
010C: 23 00 00 00 ; Compare integers for >
0110: 09 01 00 00 ; And
0114: 26 00 00 18 ; Push integer at frame+$0018
0118: 07 02 00 18 ; Push integer 24
011C: 20 00 00 00 ; Compare integers for =
0120: 09 02 01 30 ; Or, if false then jump $0130
0124: 26 00 00 18 ; Push integer at frame+$0018
0128: 28 01 00 01 ; Add 1 to integer
012C: 27 00 00 18 ; Pop integer at frame+$0018
304 N:=44-E;
0130: 07 02 00 2C ; Push integer 44
0134: 26 00 00 18 ; Push integer at frame+$0018
0138: 29 00 00 00 ; Subtract integers
013C: 27 00 00 0A ; Pop integer at frame+$000A
320 IF N<21 THEN N:=N+30;
0140: 26 00 00 0A ; Push integer at frame+$000A
0144: 07 02 00 15 ; Push integer 21
0148: 22 00 01 58 ; Compare integers for <, if false then jump $0158
014C: 26 00 00 0A ; Push integer at frame+$000A
0150: 28 01 00 1E ; Add 30 to integer
0154: 27 00 00 0A ; Pop integer at frame+$000A
344 N:=N+7-MODFN(D+N,7);
0158: 26 00 00 0A ; Push integer at frame+$000A
015C: 28 01 00 07 ; Add 7 to integer
0160: 04 00 00 02 ; Reserve 2 bytes for return value
0164: 26 00 00 16 ; Push integer at frame+$0016
0168: 26 00 00 0A ; Push integer at frame+$000A
016C: 28 00 00 00 ; Add integers
0170: 07 02 00 07 ; Push integer 7
0174: 03 01 00 04 ; Finish calling $0004
0178: 29 00 00 00 ; Subtract integers
017C: 27 00 00 0A ; Pop integer at frame+$000A
384 IF N>31 THEN
0180: 26 00 00 0A ; Push integer at frame+$000A
0184: 07 02 00 1F ; Push integer 31
0188: 23 00 01 A4 ; Compare integers for >, if false then jump $01A4
396 BEGIN
396 N:=N-31;
018C: 26 00 00 0A ; Push integer at frame+$000A
0190: 29 01 00 1F ; Subtract 31 from integer
0194: 27 00 00 0A ; Pop integer at frame+$000A
408 M:=4;
0198: 07 02 00 04 ; Push integer 4
019C: 27 00 00 0C ; Pop integer at frame+$000C
416 END
416 ELSE M:=3;
01A0: 01 00 01 AC ; Jump $01AC
01A4: 07 02 00 03 ; Push integer 3
01A8: 27 00 00 0C ; Pop integer at frame+$000C
428 WRITE(N);
01AC: 26 00 00 0A ; Push integer at frame+$000A
01B0: 2E 02 06 01 ; Write (Output) ASCII integer, field width=6
436 IF M=3 THEN WRITE(" MARCH")
01B4: 26 00 00 0C ; Push integer at frame+$000C
01B8: 07 02 00 03 ; Push integer 3
01BC: 20 00 01 D0 ; Compare integers for =, if false then jump $01D0
01C0: 07 06 20 4D ; Push string " MARCH"
01C4: 41 52 43 48
01C8: 1E 02 06 06 ; Write string (Output), field width=6, string length=6
460 ELSE WRITE(" APRIL");
01CC: 01 00 01 DC ; Jump $01DC
01D0: 07 06 20 41 ; Push string " APRIL"
01D4: 50 52 49 4C
01D8: 1E 02 06 06 ; Write string (Output), field width=6, string length=6
476 WRITELN(Y);
01DC: 26 00 00 08 ; Push integer at frame+$0008
01E0: 2E 02 06 01 ; Write (Output) ASCII integer, field width=6
01E4: 1C 02 00 00 ; Writeln (Output)
488 END; (* OF DATE OF EASTER *)
01E8: 05 00 00 00 ; Return
492 BEGIN
01EC: 06 00 00 08 ; SP := SP + $0008
496 FOR YEAR:=LIM1 TO LIM2 DO
01F0: 07 02 07 BA ; Push integer 1978
01F4: 27 00 00 08 ; Pop integer at frame+$0008
01F8: 07 02 07 D0 ; Push integer 2000
508 DATEOFEASTER(YEAR);
01FC: 26 00 00 08 ; Push integer at frame+$0008
0200: 25 01 02 20 ; Compare integers for >=, if false then jump $0220
0204: 04 00 00 00 ; Create stack frame
0208: 26 00 00 08 ; Push integer at frame+$0008
020C: 03 00 00 28 ; Finish calling $0028
0210: 28 01 00 01 ; Add 1 to integer
0214: 27 00 00 08 ; Pop integer at frame+$0008
0218: 06 00 00 02 ; SP := SP + $0002
021C: 01 00 02 00 ; Jump $0200
0220: 06 01 00 04 ; SP := SP - $0004
548 END.
0224: 00 00 00 00 ; Halt
And the eight queens sample program:
Code:
PASCAL P-COMPILER ( VERSION 1 ) : COPYRIGHT C 1978 D.R.GIBBY
0 PROGRAM EIGHTQUEENS ;
0 (* A PROGRAM TO FIND ALL 92 SOLUTIONS TO THE EIGHT QUEENS PROBLEM
0 ADAPTED FROM THE VERSIONS PUBLISHED IN
0 1. ALGORITHMS + DATA STRUCTURES = PROGRAMS ( NIKLAUS WIRTH )
0 PUBLISHED BY PRENTICE HALL
0 2. STRUCTURED PROGRAMMIING ( DAHL,DIJKSTRA,HOARE )
0 PUBLISHED BY ACADEMIC PRESS *)
0 VAR
0 I,N : INTEGER ;
0 COL : ARRAY [ 1.. 8 ] OF BOOLEAN ;
0 DOWN : ARRAY [ 2..16 ] OF BOOLEAN ;
0 UP : ARRAY [-7..+7 ] OF BOOLEAN ;
0 X : ARRAY [ 1.. 8 ] OF INTEGER ;
0 ANSWER: CHAR ;
0 PRINTING : BOOLEAN ;
0 PROCEDURE REPORT ;
4 VAR
4 K : INTEGER ;
4 BEGIN
8 N:=N+1; WRITE(N:3,":":3);
36 FOR K:= 1 TO 8 DO WRITE(X[K]:5);
92 WRITELN;
96 END;
100 PROCEDURE TRY ( I : INTEGER ) ;
100 VAR
100 J : INTEGER ;
100 BEGIN
104 FOR J:= 1 TO 8 DO
116 IF COL [ J] THEN
136 IF DOWN[I+J] THEN
160 IF UP [I-J] THEN
184 BEGIN
188 X[I]:=J;
204 COL [ J]:=FALSE;
220 DOWN[I+J]:=FALSE;
244 UP [I-J]:=FALSE;
268 IF I<8 THEN TRY(I+1) ELSE IF PRINTING THEN REPORT;
312 COL [ J]:=TRUE;
328 DOWN[I+J]:=TRUE;
352 UP [I-J]:=TRUE;
376 END;
396 END (* TRY *) ;
400 BEGIN
404 WRITE("SOLUTIONS TO BE PRINTED ? Y/N ");
440 READ(ANSWER); PRINTING:=ANSWER="Y"; WRITELN;
468 N:=0;
476 FOR I:= 1 TO 8 DO COL [I]:=TRUE;
532 FOR I:= 2 TO 16 DO DOWN[I]:=TRUE;
588 FOR I:=-7 TO 7 DO UP [I]:=TRUE;
648 TRY(1);
660 WRITELN("SEARCH COMPLETED");
688 END.
Code:
Highest opcode used: $2E
Image length: $02B4
Array subscript table:
0: 1..6
1: 1..8
2: 2..15
3: -7..15
4: 1..8
PASCAL P-COMPILER ( VERSION 1 ) : COPYRIGHT C 1978 D.R.GIBBY
0 PROGRAM EIGHTQUEENS ;
0 (* A PROGRAM TO FIND ALL 92 SOLUTIONS TO THE EIGHT QUEENS PROBLEM
0 ADAPTED FROM THE VERSIONS PUBLISHED IN
0 1. ALGORITHMS + DATA STRUCTURES = PROGRAMS ( NIKLAUS WIRTH )
0 PUBLISHED BY PRENTICE HALL
0 2. STRUCTURED PROGRAMMIING ( DAHL,DIJKSTRA,HOARE )
0 PUBLISHED BY ACADEMIC PRESS *)
0 VAR
0 I,N : INTEGER ;
0 COL : ARRAY [ 1.. 8 ] OF BOOLEAN ;
0 DOWN : ARRAY [ 2..16 ] OF BOOLEAN ;
0 UP : ARRAY [-7..+7 ] OF BOOLEAN ;
0 X : ARRAY [ 1.. 8 ] OF INTEGER ;
0 ANSWER: CHAR ;
0 PRINTING : BOOLEAN ;
0 PROCEDURE REPORT ;
0000: 01 00 01 90 ; Jump $0190
4 VAR
4 K : INTEGER ;
4 BEGIN
0004: 06 00 00 02 ; SP := SP + $0002
8 N:=N+1; WRITE(N:3,":":3);
0008: 26 01 00 0A ; Push integer at frame^+$000A
000C: 28 01 00 01 ; Add 1 to integer
0010: 27 01 00 0A ; Pop integer at frame^+$000A
0014: 26 01 00 0A ; Push integer at frame^+$000A
0018: 2E 02 03 01 ; Write (Output) ASCII integer, field width=3
001C: 07 01 00 3A ; Push character ":"
0020: 1E 02 03 01 ; Write string (Output), field width=3, string length=1
36 FOR K:= 1 TO 8 DO WRITE(X[K]:5);
0024: 07 02 00 01 ; Push integer 1
0028: 27 00 00 08 ; Pop integer at frame+$0008
002C: 07 02 00 08 ; Push integer 8
0030: 26 00 00 08 ; Push integer at frame+$0008
0034: 25 01 00 58 ; Compare integers for >=, if false then jump $0058
0038: 26 00 00 08 ; Push integer at frame+$0008
003C: 08 01 02 04 ; Determine array index, dim=1, element size=2, range=4
0040: 26 81 00 32 ; Push integer from array at frame^+$0032
0044: 2E 02 05 01 ; Write (Output) ASCII integer, field width=5
0048: 28 01 00 01 ; Add 1 to integer
004C: 27 00 00 08 ; Pop integer at frame+$0008
0050: 06 00 00 02 ; SP := SP + $0002
0054: 01 00 00 34 ; Jump $0034
0058: 06 01 00 04 ; SP := SP - $0004
92 WRITELN;
005C: 1C 02 00 00 ; Writeln (Output)
96 END;
0060: 05 00 00 00 ; Return
100 PROCEDURE TRY ( I : INTEGER ) ;
100 VAR
100 J : INTEGER ;
100 BEGIN
0064: 06 00 00 02 ; SP := SP + $0002
104 FOR J:= 1 TO 8 DO
0068: 07 02 00 01 ; Push integer 1
006C: 27 00 00 0A ; Pop integer at frame+$000A
0070: 07 02 00 08 ; Push integer 8
116 IF COL [ J] THEN
0074: 26 00 00 0A ; Push integer at frame+$000A
0078: 25 01 01 88 ; Compare integers for >=, if false then jump $0188
007C: 26 00 00 0A ; Push integer at frame+$000A
0080: 08 01 01 01 ; Determine array index, dim=1, element size=1, range=1
0084: 16 81 00 0B ; Push byte from array at frame^+$000B
136 IF DOWN[I+J] THEN
0088: 02 00 01 78 ; If false then jump $0178
008C: 26 00 00 08 ; Push integer at frame+$0008
0090: 26 00 00 0A ; Push integer at frame+$000A
0094: 28 00 00 00 ; Add integers
0098: 08 01 01 02 ; Determine array index, dim=1, element size=1, range=2
009C: 16 81 00 13 ; Push byte from array at frame^+$0013
160 IF UP [I-J] THEN
00A0: 02 00 01 78 ; If false then jump $0178
00A4: 26 00 00 08 ; Push integer at frame+$0008
00A8: 26 00 00 0A ; Push integer at frame+$000A
00AC: 29 00 00 00 ; Subtract integers
00B0: 08 01 01 03 ; Determine array index, dim=1, element size=1, range=3
00B4: 16 81 00 22 ; Push byte from array at frame^+$0022
184 BEGIN
00B8: 02 00 01 78 ; If false then jump $0178
188 X[I]:=J;
00BC: 26 00 00 08 ; Push integer at frame+$0008
00C0: 08 01 02 04 ; Determine array index, dim=1, element size=2, range=4
00C4: 26 00 00 0A ; Push integer at frame+$000A
00C8: 27 81 00 32 ; Pop integer into array at frame^+$0032
204 COL [ J]:=FALSE;
00CC: 26 00 00 0A ; Push integer at frame+$000A
00D0: 08 01 01 01 ; Determine array index, dim=1, element size=1, range=1
00D4: 07 01 00 00 ; Push byte "00"
00D8: 17 81 00 0B ; Pop byte into array at frame^+$000B
220 DOWN[I+J]:=FALSE;
00DC: 26 00 00 08 ; Push integer at frame+$0008
00E0: 26 00 00 0A ; Push integer at frame+$000A
00E4: 28 00 00 00 ; Add integers
00E8: 08 01 01 02 ; Determine array index, dim=1, element size=1, range=2
00EC: 07 01 00 00 ; Push byte "00"
00F0: 17 81 00 13 ; Pop byte into array at frame^+$0013
244 UP [I-J]:=FALSE;
00F4: 26 00 00 08 ; Push integer at frame+$0008
00F8: 26 00 00 0A ; Push integer at frame+$000A
00FC: 29 00 00 00 ; Subtract integers
0100: 08 01 01 03 ; Determine array index, dim=1, element size=1, range=3
0104: 07 01 00 00 ; Push byte "00"
0108: 17 81 00 22 ; Pop byte into array at frame^+$0022
268 IF I<8 THEN TRY(I+1) ELSE IF PRINTING THEN REPORT;
010C: 26 00 00 08 ; Push integer at frame+$0008
0110: 07 02 00 08 ; Push integer 8
0114: 22 00 01 2C ; Compare integers for <, if false then jump $012C
0118: 04 00 00 00 ; Create stack frame
011C: 26 00 00 08 ; Push integer at frame+$0008
0120: 28 01 00 01 ; Add 1 to integer
0124: 03 01 00 64 ; Finish calling $0064
0128: 01 00 01 38 ; Jump $0138
012C: 16 01 00 42 ; Push byte at frame^+$0042
0130: 02 00 01 38 ; If false then jump $0138
0134: 04 81 00 04 ; Call $0004
312 COL [ J]:=TRUE;
0138: 26 00 00 0A ; Push integer at frame+$000A
013C: 08 01 01 01 ; Determine array index, dim=1, element size=1, range=1
0140: 07 01 00 FF ; Push byte "FF"
0144: 17 81 00 0B ; Pop byte into array at frame^+$000B
328 DOWN[I+J]:=TRUE;
0148: 26 00 00 08 ; Push integer at frame+$0008
014C: 26 00 00 0A ; Push integer at frame+$000A
0150: 28 00 00 00 ; Add integers
0154: 08 01 01 02 ; Determine array index, dim=1, element size=1, range=2
0158: 07 01 00 FF ; Push byte "FF"
015C: 17 81 00 13 ; Pop byte into array at frame^+$0013
352 UP [I-J]:=TRUE;
0160: 26 00 00 08 ; Push integer at frame+$0008
0164: 26 00 00 0A ; Push integer at frame+$000A
0168: 29 00 00 00 ; Subtract integers
016C: 08 01 01 03 ; Determine array index, dim=1, element size=1, range=3
0170: 07 01 00 FF ; Push byte "FF"
0174: 17 81 00 22 ; Pop byte into array at frame^+$0022
376 END;
0178: 28 01 00 01 ; Add 1 to integer
017C: 27 00 00 0A ; Pop integer at frame+$000A
0180: 06 00 00 02 ; SP := SP + $0002
0184: 01 00 00 78 ; Jump $0078
0188: 06 01 00 04 ; SP := SP - $0004
396 END (* TRY *) ;
018C: 05 00 00 00 ; Return
400 BEGIN
0190: 06 00 00 42 ; SP := SP + $0042
404 WRITE("SOLUTIONS TO BE PRINTED ? Y/N ");
0194: 07 1E 53 4F ; Push string "SOLUTIONS TO BE PRINTED ? Y/N "
0198: 4C 55 54 49
019C: 4F 4E 53 20
01A0: 54 4F 20 42
01A4: 45 20 50 52
01A8: 49 4E 54 45
01AC: 44 20 3F 20
01B0: 59 2F 4E 20
01B4: 1E 02 1E 1E ; Write string (Output), field width=30, string length=30
440 READ(ANSWER); PRINTING:=ANSWER="Y"; WRITELN;
01B8: 1F 01 00 01 ; Read (Input) character
01BC: 17 00 00 41 ; Pop byte at frame+$0041
01C0: 16 00 00 41 ; Push byte at frame+$0041
01C4: 07 01 00 59 ; Push character "Y"
01C8: 10 00 00 00 ; Compare bytes for =
01CC: 17 00 00 42 ; Pop byte at frame+$0042
01D0: 1C 02 00 00 ; Writeln (Output)
468 N:=0;
01D4: 07 02 00 00 ; Push integer 0
01D8: 27 00 00 0A ; Pop integer at frame+$000A
476 FOR I:= 1 TO 8 DO COL [I]:=TRUE;
01DC: 07 02 00 01 ; Push integer 1
01E0: 27 00 00 08 ; Pop integer at frame+$0008
01E4: 07 02 00 08 ; Push integer 8
01E8: 26 00 00 08 ; Push integer at frame+$0008
01EC: 25 01 02 10 ; Compare integers for >=, if false then jump $0210
01F0: 26 00 00 08 ; Push integer at frame+$0008
01F4: 08 01 01 01 ; Determine array index, dim=1, element size=1, range=1
01F8: 07 01 00 FF ; Push byte "FF"
01FC: 17 80 00 0B ; Pop byte into array at frame+$000B
0200: 28 01 00 01 ; Add 1 to integer
0204: 27 00 00 08 ; Pop integer at frame+$0008
0208: 06 00 00 02 ; SP := SP + $0002
020C: 01 00 01 EC ; Jump $01EC
0210: 06 01 00 04 ; SP := SP - $0004
532 FOR I:= 2 TO 16 DO DOWN[I]:=TRUE;
0214: 07 02 00 02 ; Push integer 2
0218: 27 00 00 08 ; Pop integer at frame+$0008
021C: 07 02 00 10 ; Push integer 16
0220: 26 00 00 08 ; Push integer at frame+$0008
0224: 25 01 02 48 ; Compare integers for >=, if false then jump $0248
0228: 26 00 00 08 ; Push integer at frame+$0008
022C: 08 01 01 02 ; Determine array index, dim=1, element size=1, range=2
0230: 07 01 00 FF ; Push byte "FF"
0234: 17 80 00 13 ; Pop byte into array at frame+$0013
0238: 28 01 00 01 ; Add 1 to integer
023C: 27 00 00 08 ; Pop integer at frame+$0008
0240: 06 00 00 02 ; SP := SP + $0002
0244: 01 00 02 24 ; Jump $0224
0248: 06 01 00 04 ; SP := SP - $0004
588 FOR I:=-7 TO 7 DO UP [I]:=TRUE;
024C: 07 02 00 07 ; Push integer 7
0250: 2C 00 00 00 ; Negate integer
0254: 27 00 00 08 ; Pop integer at frame+$0008
0258: 07 02 00 07 ; Push integer 7
025C: 26 00 00 08 ; Push integer at frame+$0008
0260: 25 01 02 84 ; Compare integers for >=, if false then jump $0284
0264: 26 00 00 08 ; Push integer at frame+$0008
0268: 08 01 01 03 ; Determine array index, dim=1, element size=1, range=3
026C: 07 01 00 FF ; Push byte "FF"
0270: 17 80 00 22 ; Pop byte into array at frame+$0022
0274: 28 01 00 01 ; Add 1 to integer
0278: 27 00 00 08 ; Pop integer at frame+$0008
027C: 06 00 00 02 ; SP := SP + $0002
0280: 01 00 02 60 ; Jump $0260
0284: 06 01 00 04 ; SP := SP - $0004
648 TRY(1);
0288: 04 00 00 00 ; Create stack frame
028C: 07 02 00 01 ; Push integer 1
0290: 03 00 00 64 ; Finish calling $0064
660 WRITELN("SEARCH COMPLETED");
0294: 07 10 53 45 ; Push string "SEARCH COMPLETED"
0298: 41 52 43 48
029C: 20 43 4F 4D
02A0: 50 4C 45 54
02A4: 45 44 22 29
02A8: 1E 02 10 10 ; Write string (Output), field width=16, string length=16
02AC: 1C 02 00 00 ; Writeln (Output)
688 END.
02B0: 00 00 00 00 ; Halt