6502.org Forum  Projects  Code  Documents  Tools  Forum
It is currently Wed Jun 26, 2024 6:53 am

All times are UTC




Post new topic Reply to topic  [ 54 posts ]  Go to page Previous  1, 2, 3, 4  Next
Author Message
PostPosted: Sat Nov 13, 2021 10:29 am 
Offline

Joined: Thu Mar 12, 2020 10:04 pm
Posts: 694
Location: North Tejas
I just found yet another bug in the LUCIDATA compiler and it is a whopper.

The code to range check array subscripts has an off-by-one error in it, but because it involves the upper byte of a sixteen-bit comparison, it is actually an off-by-256 error. The bgt instruction was used when it should have been bge.

The test program:

Code:
PROGRAM TEST;

  VAR
    A : ARRAY [1..6] OF CHAR;

  BEGIN
    WRITELN("Attempt to write to A[7]...");
    A[7] := "!";
    WRITELN("It let me!");
    WRITELN("Attempt to write to A[8]...");
    A[8] := "!";
    WRITELN("It let me!");
    WRITELN("Attempt to write to A[6+256]...");
    A[6+256] := "!";
    WRITELN("It let me!");
    WRITELN("Attempt to write to A[7+256]...");
    A[7+256] := "!";
    WRITELN("It better not let me!!");
    WRITELN("Attempt to write to A[8+256]...");
    A[8+256] := "!";
    WRITELN("It darn better not let me!!!")
  END.


It does not error out until attempting A[7+256] := "!"


Top
 Profile  
Reply with quote  
PostPosted: Sun Nov 14, 2021 6:22 pm 
Offline
User avatar

Joined: Wed Feb 14, 2018 2:33 pm
Posts: 1435
Location: Scotland
BillG wrote:
I just found yet another bug in the LUCIDATA compiler and it is a whopper.

The code to range check array subscripts has an off-by-one error in it, but because it involves the upper byte of a sixteen-bit comparison, it is actually an off-by-256 error. The bgt instruction was used when it should have been bge.


Makes you wonder just how many old programs used to crash unexpectedly 'back in the day' due to this - or how many programs would stop working correctly when re-compiled with a fixed compiler and run-time...

-Gordon

_________________
--
Gordon Henderson.
See my Ruby 6502 and 65816 SBC projects here: https://projects.drogon.net/ruby/


Top
 Profile  
Reply with quote  
PostPosted: Mon Nov 15, 2021 11:38 am 
Offline

Joined: Thu Mar 12, 2020 10:04 pm
Posts: 694
Location: North Tejas
drogon wrote:
Makes you wonder just how many old programs used to crash unexpectedly 'back in the day' due to this

Because the software stack of LUCIDATA Pascal grows from low address to high, such an error is less likely to do damage. If the stack grew from high to low, the error is much more likely to have an effect.

I doubt that is why they chose to make the stack that way. On a processor like the 6502 with only positive indexing, it is much easier to use memory above the top of an upward-growing stack for scratch space.

drogon wrote:
- or how many programs would stop working correctly when re-compiled with a fixed compiler and run-time...

That happens more often than you would think. I have battle scars to show for it.


On a wild tangent, I am pondering the feasibility of compiling Pascal into FORTH instead of P-code. Since I do not have an easy way to debug FORTH code, that is a project for way in the future, if ever.


Top
 Profile  
Reply with quote  
PostPosted: Wed Nov 17, 2021 6:17 am 
Offline

Joined: Thu Mar 12, 2020 10:04 pm
Posts: 694
Location: North Tejas
I am starting to get simple cases of subroutines and activation records working.
Code:
PROGRAM TEST;

  PROCEDURE DOIT;

    BEGIN
      WRITELN("Hello world.")
    END;

  BEGIN
    DOIT
  END.

Code:
PROGRAM TEST;

  VAR
    I : INTEGER;

  FUNCTION F : INTEGER;

    BEGIN
      F := 1
    END;

  BEGIN
    WRITELN(F)
  END.

Passing parameters is not working correctly and there are still parts I do not yet understand.


Top
 Profile  
Reply with quote  
PostPosted: Wed Nov 17, 2021 8:06 am 
Offline

Joined: Thu Mar 12, 2020 10:04 pm
Posts: 694
Location: North Tejas
The Productive Night of Hacking™ continues...

I just fixed a bug in the handling of stack frames.

This is the original 6800 code:
Code:
                          00828 *
                          00829 ; Locate activation record
                          00830 *
 045A                     00831 L_045A
 045A DE CD           [4] 00832          ldx    $CD
 045C C4 0F           [2] 00833          andb   #$F       ; Max nesting?
 045E 27 05 (0465)    [4] 00834          beq    L_0465    ; Topmost?
                          00835
 0460                     00836 L_0460
 0460 EE 01           [6] 00837          ldx    1,X
 0462 5A              [2] 00838          decb
 0463 26 FB (0460)    [4] 00839          bne    L_0460
                          00840
 0465                     00841 L_0465
 0465 DF DD           [5] 00842          stx    $DD
                          00843
 0467 39              [5] 00844          rts

And this is the faulty 6502 version:
Code:
                          03662 *
                          03663 ; Locate activation record
                          03664 *
 3383                     03665 L_045A
                          03666 ; ldx $CD
 3383 A5 04           [3] 03667          lda    Reg_FP
 3385 85 02           [3] 03668          sta    Ptr
 3387 A5 05           [3] 03669          lda    Reg_FP+1
 3389 85 03           [3] 03670          sta    Ptr+1
                          03671
 338B 8A              [2] 03672          txa
 338C 29 0F           [2] 03673          and    #$F       ; Max nesting?
 338E F0 12 (33A2)  [2/3] 03674          beq    L_0465    ; Topmost?
                          03675
 3390 85 14           [3] 03676          sta    Tmp
                          03677
 3392 A0 01           [2] 03678          ldy    #1
                          03679
 3394                     03680 L_0460
 3394 B1 02         [5/6] 03681          lda    (Ptr),Y
 3396 AA              [2] 03682          tax
 3397 C8              [2] 03683          iny
 3398 B1 02         [5/6] 03684          lda    (Ptr),Y
 339A 85 03           [3] 03685          sta    Ptr+1
 339C 86 02           [3] 03686          stx    Ptr
                          03687
 339E C6 14           [5] 03688          dec    Tmp
 33A0 D0 F2 (3394)  [2/3] 03689          bne    L_0460
                          03690
 33A2                     03691 L_0465
                          03692 ; stx $DD
                          03693
 33A2 60              [6] 03694          rts

Can you spot the error? Solution at the bottom of this post.

Now this test program works:
Code:
PROGRAM TEST;

  VAR
    I : INTEGER;

  PROCEDURE DEEP;

    VAR
      J : INTEGER;

    PROCEDURE DEEPER;

      VAR
        K : INTEGER;

      PROCEDURE DEEPEST;

        VAR
          L : INTEGER;

        BEGIN
          L := 4;

          WRITE(I);
          WRITE(J);
          WRITE(K);
          WRITELN(L)
        END;

      BEGIN
        K := 3;

        DEEPEST
      END;

    BEGIN
      J := 2;

      DEEPER
    END;

  BEGIN
    I := 1;

    DEEP
  END.


The corrected 6502 code:
Code:
                          03662 *
                          03663 ; Locate activation record
                          03664 *
 3383                     03665 L_045A
                          03666 ; ldx $CD
 3383 A5 04           [3] 03667          lda    Reg_FP
 3385 85 02           [3] 03668          sta    Ptr
 3387 A5 05           [3] 03669          lda    Reg_FP+1
 3389 85 03           [3] 03670          sta    Ptr+1
                          03671
 338B 8A              [2] 03672          txa
 338C 29 0F           [2] 03673          and    #$F       ; Max nesting?
 338E F0 13 (33A3)  [2/3] 03674          beq    L_0465    ; Topmost?
                          03675
 3390 85 14           [3] 03676          sta    Tmp
                          03677
 3392 A0 01           [2] 03678          ldy    #1
                          03679
 3394                     03680 L_0460
 3394 B1 02         [5/6] 03681          lda    (Ptr),Y
 3396 AA              [2] 03682          tax
 3397 C8              [2] 03683          iny              ; Y is 2
 3398 B1 02         [5/6] 03684          lda    (Ptr),Y
 339A 88              [2] 03685          dey              ; Y is back to 1
 339B 85 03           [3] 03686          sta    Ptr+1
 339D 86 02           [3] 03687          stx    Ptr
                          03688
 339F C6 14           [5] 03689          dec    Tmp
 33A1 D0 F1 (3394)  [2/3] 03690          bne    L_0460
                          03691
 33A3                     03692 L_0465
                          03693 ; stx $DD
                          03694
 33A3 60              [6] 03695          rts


Top
 Profile  
Reply with quote  
PostPosted: Wed Nov 17, 2021 8:33 am 
Offline
User avatar

Joined: Sun Jun 30, 2013 10:26 pm
Posts: 1938
Location: Sacramento, CA, USA
I think you should be able to get rid of the DEY in the loop by just BNEing up to the LDY #1, right?

What's stored at 6800 address 0,X or 6502 address (Ptr),0 ? I can see that +1 and +2 form an address, but what's going on at +0 ?

_________________
Got a kilobyte lying fallow in your 65xx's memory map? Sprinkle some VTL02C on it and see how it grows on you!

Mike B. (about me) (learning how to github)


Top
 Profile  
Reply with quote  
PostPosted: Wed Nov 17, 2021 8:45 am 
Offline

Joined: Thu Mar 12, 2020 10:04 pm
Posts: 694
Location: North Tejas
barrym95838 wrote:
I think you should be able to get rid of the DEY in the loop by just BNEing up to the LDY #1, right?

Good eye! You are right. Thanks.

barrym95838 wrote:
What's stored at 6800 address 0,X or 6502 address (Ptr),0 ? I can see that +1 and +2 form an address, but what's going on at +0 ?

The software stack grows from low to high address. The stack pointer points to the highest byte of the item on top of the stack instead of the next free location. As activation records are built on the stack, the frame pointer points to the byte before the record.


Top
 Profile  
Reply with quote  
PostPosted: Wed Nov 17, 2021 12:22 pm 
Offline

Joined: Thu Mar 12, 2020 10:04 pm
Posts: 694
Location: North Tejas
I am starting to play with the demo programs supplied with the compiler, compiled on the 6800 and executed on the 6502.

One of them is WAITSECS
Code:
PROGRAM WAITSECS ( INPUT,OUTPUT ) ;
VAR
   NSECS : INTEGER ;
PROCEDURE WAIT ( N : INTEGER ) ;
CONST
   NTIMES = 800 ;
   (* WITH A 1 M-HZ PROCESSOR,
      AND WITH THE PASCAL SYSTEM NOT IN PAGING MODE,
      THE VALUE OF 800 WILL GIVE A 1 SEC DELAY    *)
VAR
   LOOP,DUMMY,SECONDS : INTEGER ;
BEGIN
   FOR SECONDS:=1 TO N DO
   FOR LOOP   :=1 TO NTIMES DO DUMMY:=DUMMY;
END;
BEGIN
   REPEAT
      WRITE(" HOW MANY SECONDS DELAY ? ");
      READLN(NSECS);
      WAIT ( NSECS ) ;
   UNTIL NSECS=0 ;
END.

The WAIT procedure is supposed to provide a programmed delay of about one second.

The compiled P-code is:
Code:
Hexadecimal dump of waitsecs.bin

00000000: 00 2F 00 B0 00 01 00 01-00 06 01 00 00 64 06 00  |./...........d..|
00000010: 00 06 07 02 00 01 27 00-00 0E 26 00 00 08 26 00  |......'...&...&.|
00000020: 00 0E 25 01 00 5C 07 02-00 01 27 00 00 0A 07 02  |..%..\....'.....|
00000030: 03 20 26 00 00 0A 25 01-00 48 26 00 00 0C 27 00  |. &...%..H&...'.|
00000040: 00 0C 28 01 00 01 27 00-00 0A 06 00 00 02 01 00  |..(...'.........|
00000050: 00 2C 06 01 00 04 28 01-00 01 27 00 00 0E 06 00  |.,....(...'.....|
00000060: 00 02 01 00 00 18 06 01-00 04 05 00 00 00 06 00  |................|
00000070: 00 08 07 1A 20 48 4F 57-20 4D 41 4E 59 20 53 45  |.... HOW MANY SE|
00000080: 43 4F 4E 44 53 20 44 45-4C 41 59 20 3F 20 1E 02  |CONDS DELAY ? ..|
00000090: 1A 1A 2F 01 00 01 27 00-00 08 1D 01 00 00 04 00  |../...'.........|
000000A0: 00 00 26 00 00 08 03 00-00 04 26 00 00 08 07 02  |..&.......&.....|
000000B0: 00 00 20 00 00 68 00 00-00 00 00 00 00 00 00 00  |.. ..h..........|


0000: 01 00 00 64 ; Jump 0064

0004: 06 00 00 06 ; SP := SP + 6
0008: 07 02 00 01 ; Push integer "1"
000C: 27 00 00 0E ; Pop integer
0010: 26 00 00 08 ; Push integer
0014: 26 00 00 0E ; Push integer
0018: 25 01 00 5C ; Compare for >=
001C: 07 02 00 01 ; Push integer "1"
0020: 27 00 00 0A ; Pop integer
0024: 07 02 03 20 ; Push integer "800"
0028: 26 00 00 0A ; Push integer
002C: 25 01 00 48 ; Compare for >=
0030: 26 00 00 0C ; Push integer
0034: 27 00 00 0C ; Pop integer
0038: 28 01 00 01 ; Add integer
003C: 27 00 00 0A ; Pop integer
0040: 06 00 00 02 ; SP := SP + 2
0044: 01 00 00 2C ; Jump 002C
0048: 06 01 00 04 ; SP := SP - 4
004C: 28 01 00 01 ; Add integer
0050: 27 00 00 0E ; Pop integer
0054: 06 00 00 02 ; SP := SP + 2
0058: 01 00 00 18 ; Jump 0018
005C: 06 01 00 04 ; SP := SP - 4
0060: 05 00 00 00 ; Return

0064: 06 00 00 08 ; SP := SP + 8
0068: 07 1A 20 48 ; Push string " HOW MANY SECONDS DELAY ? "
006C: 4F 57 20 4D
0070: 41 4E 59 20
0074: 53 45 43 4F
0078: 4E 44 53 20
007C: 44 45 4C 41
0080: 59 20 3F 20
0084: 1E 02 1A 1A ; Write string (Output)
0088: 2F 01 00 01 ; Read integer
008C: 27 00 00 08 ; Pop integer
0090: 1D 01 00 00 ; Readln
0094: 04 00 00 00 ; Create stack frame
0098: 26 00 00 08 ; Push NSECS
009C: 03 00 00 04 ; Call
00A0: 26 00 00 08 ; Push NSECS
00A4: 07 02 00 00 ; Push integer "0"
00A8: 20 00 00 68 ; Compare for =
00AC: 00 00 00 00 ; Halt

The 6502 interpreter takes 1122678 machine cycles to get from the end of the Readln instruction at $0090 to the beginning of the Write string instruction at $0084. I have not done any speed optimization work yet.

The 6800 version takes 1014330 cycles to do the same.


Top
 Profile  
Reply with quote  
PostPosted: Wed Nov 17, 2021 4:17 pm 
Offline
User avatar

Joined: Sun Jun 30, 2013 10:26 pm
Posts: 1938
Location: Sacramento, CA, USA
The 6502 struggles a bit with a direct translation of the little powerhouse that is the 68xx's LDX offset8,X. From your little cycle test, it looks like it makes up for it elsewhere, but a different mindset and refactoring are probably needed if you really want to make the 6502 shine. I ran into some of the same issues when I ported VTL-2, but I kept trying different strategies until I found a way to it in proper 6502 style. My results were about 25% larger but ended up at least 25% quicker in a side-by-side comparison.

Although I have never tried to do it, it seems not too much different than trying to translate a song or a poem from one human language to another. Some artistic license is sometimes needed to clean up the rough spots.

_________________
Got a kilobyte lying fallow in your 65xx's memory map? Sprinkle some VTL02C on it and see how it grows on you!

Mike B. (about me) (learning how to github)


Top
 Profile  
Reply with quote  
PostPosted: Tue Nov 23, 2021 5:59 am 
Offline

Joined: Thu Mar 12, 2020 10:04 pm
Posts: 694
Location: North Tejas
barrym95838 wrote:
The 6502 struggles a bit with a direct translation of the little powerhouse that is the 68xx's LDX offset8,X. From your little cycle test, it looks like it makes up for it elsewhere, but a different mindset and refactoring are probably needed if you really want to make the 6502 shine. I ran into some of the same issues when I ported VTL-2, but I kept trying different strategies until I found a way to it in proper 6502 style. My results were about 25% larger but ended up at least 25% quicker in a side-by-side comparison

The 6800 code is penalized for having only one index register. The 6502 code was able in most places to use two pointers in the zero page and index them both with the same value in Y.

My hands are tied somewhat by having to keep the same binary format for the P-code instructions.


Top
 Profile  
Reply with quote  
PostPosted: Tue Nov 23, 2021 6:49 am 
Offline

Joined: Thu Mar 12, 2020 10:04 pm
Posts: 694
Location: North Tejas
I am still working through the supplied demo programs.

I am also analyzing the compiler itself. Some of the findings so far:

* The run-time system special-cases the compiler. It looks for "PASCAL.BIN" as the program name, and upon finding it, performs specific initialization.
* There are two P-code instructions yet to be identified. One of them is definitely used by the compiler; it does two distinct things depending upon the "mode" byte. One has something to do with the length of a line of source code; the other appears to be for looking up something in the symbol table.
* The compiler "peeks" at location $00FB to see whether a listing is requested; this location is initialized by the special initialization in the run-time system.


Top
 Profile  
Reply with quote  
PostPosted: Sat Nov 27, 2021 12:40 pm 
Offline

Joined: Thu Mar 12, 2020 10:04 pm
Posts: 694
Location: North Tejas
While the guru meditates over getting the compiler to run, I am writing a P-code disassembler. The framework is done and I am now adding instruction handlers. It runs on both the 6800 and 6502.


Top
 Profile  
Reply with quote  
PostPosted: Sun Dec 05, 2021 2:30 pm 
Offline

Joined: Thu Mar 12, 2020 10:04 pm
Posts: 694
Location: North Tejas
I just uploaded the initial version of the documentation of the run-time system to my repo.

https://github.com/BillGee1/P-6502


Top
 Profile  
Reply with quote  
PostPosted: Mon Dec 06, 2021 2:45 pm 
Offline

Joined: Thu Mar 12, 2020 10:04 pm
Posts: 694
Location: North Tejas
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.

Why? I have previously mentioned that I am writing a P-code disassembler as a means to stress test my project. A command "RUN DISM DISM.BIN" directs the disassembler to disassemble itself.

The compiler does not provide any access to the command line. In return, the run-time system parses it and sets up file control blocks with the names of any files specified. The run-time system specifies that a logical file with no associated physical file defaults to the system console. That can be quite useful behavior.

A command "RUN DISM DISM.BIN" writes the output to the console while "RUN DISM DISM.BIN DISM.OUT" writes it to a file, no extra programming needed.

The problem is that I cannot detect the case of just "RUN DISM" with no P-code file named. The file defaults to the console, but I am not allowed to test eof status of a file of byte. Why I do not know as I am allowed to check for eof of a file of char. I cannot read the bytes as chars because chars outside of $00..$7F result in a fatal error.

The problem is that the data structures start at $0180 and runs up through $01A9. I am not sure that the locations near $01A9 can be guaranteed safe from being overwritten by the hardware stack.

Thank you 8bitPogle for starting a thread about memory use viewtopic.php?f=2&t=6904 . The 6502 overly complicates things by its heavy reliance upon the zero page and a stack limited to page 1.

Reading the discussion gave me an idea. If I relocate the hardware stack to the memory range $0100..$017F, I can get things to work.

Then by peeking at those internal data structures, I can determine whether the logical file for the P-code is associated an actual file.


Top
 Profile  
Reply with quote  
PostPosted: Sat Dec 11, 2021 7:49 am 
Offline

Joined: Thu Mar 12, 2020 10:04 pm
Posts: 694
Location: North Tejas
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


Top
 Profile  
Reply with quote  
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 54 posts ]  Go to page Previous  1, 2, 3, 4  Next

All times are UTC


Who is online

Users browsing this forum: No registered users and 42 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to: