         Edinburgh IMP77 Compiler - Version 8.4-2024.12.18

     1  %begin
 0000 C8 00 00 01                           ENTER 0000,1
     2  
     3  !
     4  ! Precedence of operators
     5  !
     6  ! Highest: 1. \ (complement, unary not)
     7  !          2. \, \\, <<, >>
     8  !          3. *, /, //, &
     9  ! Lowest:  4. +, - (unary and binary), !, !!
    10  !
    11  ! In general, sub-expressions with operators of equal precedence are evaluated from left to right.
    12  !
    13  ! The one exception to the left-hand precedence rule is that consecutive
    14  ! exponentiations are evaluated from right to left; thus A**B**C is
    15  ! evaluated as A**(B**C), not as (A**B)**C.  (Imp80 documentation)
    16  
    17  ! Arithmetic operators:
    18  
    19  ! |...| modulus              also: !...!  (deprecated some time ago)
    20  
    21  ! !  inclusive or
    22  ! !! exclusive or
    23  ! &  and
    24  
    25  ! \  real exponentiation     also:  ^  (Imp77)  or  **    (ERCC compilers)
    26  ! \\ integer exponentiation  also:  ^^ (Imp77)  or  ****
    27  
    28  ! *  multiply
    29  ! /  real division
    30  ! // integer division
    31  
    32  ! << left shift
    33  ! >> right shift
    34  
    35  ! +  plus
    36  ! -  minus
    37  
    38  ! +  unary +                 
    39  ! -  unary -
    40  ! \  unary not               also ~ (can be *displayed* as: ¬ (&not;))
    41  
    42  ! .  string concatenation
    43  
    44  ! Comparison operators:
    45  ! =  eq
    46  ! #  not equals              also \= and <> (Imp80 documentation)
    47  ! == address equals
    48  ! ## address not equals      also \==
    49  ! -> string resolution       (a difficult to classify hybrid of a comparison and an assignment operator)
    50  ! <= less than or equals
    51  ! <  less than
    52  ! >= greater than or equals
    53  ! >
    54  
    55  ! Assignment operators:
    56  ! =  assignment
    57  ! == pointer assignment
    58  ! <- jam transfer
    59  ! -> string resolution
    60  
    61  ! Data structure operators:
    62  ! _  record field
    63  ! () array indexing
    64  ! [] pointer increment       (a Hamish extension in 68000 Imp only)
    65  
    66  ! Other:
    67  ! @  may be considered an operator in %real literals, usually handled by a BIP.
    68  
    69  
    70    %const %integer a = 19, b = 17, c = 5, d = 3
    71    %integer x = a * b // c * d
 0004 C7 45 F8 C0 00 00 00                  MOV DWORD PTR [%EBP-8],#192
    72    print string("Imp77 precedence and associativity test."); newlines(2)
 000B 81 EC 00 01 00 00                     SUB %ESP,#256
 0011 89 E0                                 MOV %EAX,%ESP
 0013 50                                    PUSH %EAX
 0014 B8 00 00 00 00                        MOV %EAX,COT+#0
 0019 50                                    PUSH %EAX
 001A 68 FF 00 00 00                        PUSH #255
 001F E8 03 00                              CALL '_IMPSTRCPY' (EXTERN 3)
 0022 83 C4 0C                              ADD %ESP,#12
 0025 E8 3B 00                              CALL 'PRINTSTRING' (EXTERN 59)
 0028 81 C4 00 01 00 00                     ADD %ESP,#256
 002E 6A 02                                 PUSH #2
 0030 E8 44 00                              CALL 'NEWLINES' (EXTERN 68)
 0033 83 C4 04                              ADD %ESP,#4
    73    %if x = 21 %start
 0036 8B 45 F8                              MOV %EAX,[%EBP-8]
 0039 3D 15 00 00 00                        CMP %EAX,#21
 003E 75 00                                 JNE L1001
    74      print string("In a * b // c * d, '*' has higher priority than '/'."); newline
 0040 81 EC 00 01 00 00                     SUB %ESP,#256
 0046 89 E0                                 MOV %EAX,%ESP
 0048 50                                    PUSH %EAX
 0049 B8 29 00 00 00                        MOV %EAX,COT+#41
 004E 50                                    PUSH %EAX
 004F 68 FF 00 00 00                        PUSH #255
 0054 E8 03 00                              CALL '_IMPSTRCPY' (EXTERN 3)
 0057 83 C4 0C                              ADD %ESP,#12
 005A E8 3B 00                              CALL 'PRINTSTRING' (EXTERN 59)
 005D 81 C4 00 01 00 00                     ADD %ESP,#256
 0063 E8 43 00                              CALL 'NEWLINE' (EXTERN 67)
    75      print string("A second test with '/' will be needed to determine associativity:"); newline
 0066 81 EC 00 01 00 00                     SUB %ESP,#256
 006C 89 E0                                 MOV %EAX,%ESP
 006E 50                                    PUSH %EAX
 006F B8 5E 00 00 00                        MOV %EAX,COT+#94
 0074 50                                    PUSH %EAX
 0075 68 FF 00 00 00                        PUSH #255
 007A E8 03 00                              CALL '_IMPSTRCPY' (EXTERN 3)
 007D 83 C4 0C                              ADD %ESP,#12
 0080 E8 3B 00                              CALL 'PRINTSTRING' (EXTERN 59)
 0083 81 C4 00 01 00 00                     ADD %ESP,#256
 0089 E8 43 00                              CALL 'NEWLINE' (EXTERN 67)
    76      x = a // c // d
 008C C7 45 F8 01 00 00 00                  MOV DWORD PTR [%EBP-8],#1
    77      %if x = 1 %start
 0093 8B 45 F8                              MOV %EAX,[%EBP-8]
 0096 3D 01 00 00 00                        CMP %EAX,#1
 009B 75 00                                 JNE L1002
    78        print string("a // c // d is right associative, i.e. a // (b // c)"); newline
 009D 81 EC 00 01 00 00                     SUB %ESP,#256
 00A3 89 E0                                 MOV %EAX,%ESP
 00A5 50                                    PUSH %EAX
 00A6 B8 A0 00 00 00                        MOV %EAX,COT+#160
 00AB 50                                    PUSH %EAX
 00AC 68 FF 00 00 00                        PUSH #255
 00B1 E8 03 00                              CALL '_IMPSTRCPY' (EXTERN 3)
 00B4 83 C4 0C                              ADD %ESP,#12
 00B7 E8 3B 00                              CALL 'PRINTSTRING' (EXTERN 59)
 00BA 81 C4 00 01 00 00                     ADD %ESP,#256
 00C0 E8 43 00                              CALL 'NEWLINE' (EXTERN 67)
    79      %else %if x = 19
 00C3 EB 00                                 JMP L1003
 00C5                      L1002  EQU $
 00C5 8B 45 F8                              MOV %EAX,[%EBP-8]
 00C8 3D 13 00 00 00                        CMP %EAX,#19
 00CD 75 00                                 JNE L1004
    80        print string("a // c // d is left associative, i.e. (a // b) // c"); newline
 00CF 81 EC 00 01 00 00                     SUB %ESP,#256
 00D5 89 E0                                 MOV %EAX,%ESP
 00D7 50                                    PUSH %EAX
 00D8 B8 D5 00 00 00                        MOV %EAX,COT+#213
 00DD 50                                    PUSH %EAX
 00DE 68 FF 00 00 00                        PUSH #255
 00E3 E8 03 00                              CALL '_IMPSTRCPY' (EXTERN 3)
 00E6 83 C4 0C                              ADD %ESP,#12
 00E9 E8 3B 00                              CALL 'PRINTSTRING' (EXTERN 59)
 00EC 81 C4 00 01 00 00                     ADD %ESP,#256
 00F2 E8 43 00                              CALL 'NEWLINE' (EXTERN 67)
    81      %else
 00F5 EB 00                                 JMP L1003
 00F7                      L1004  EQU $
    82        print string("a // c // d is something weird!  I give up."); newline
 00F7 81 EC 00 01 00 00                     SUB %ESP,#256
 00FD 89 E0                                 MOV %EAX,%ESP
 00FF 50                                    PUSH %EAX
 0100 B8 09 01 00 00                        MOV %EAX,COT+#265
 0105 50                                    PUSH %EAX
 0106 68 FF 00 00 00                        PUSH #255
 010B E8 03 00                              CALL '_IMPSTRCPY' (EXTERN 3)
 010E 83 C4 0C                              ADD %ESP,#12
 0111 E8 3B 00                              CALL 'PRINTSTRING' (EXTERN 59)
 0114 81 C4 00 01 00 00                     ADD %ESP,#256
 011A E8 43 00                              CALL 'NEWLINE' (EXTERN 67)
    83      %finish
 011D                      L1003  EQU $
    84    %else %if x = 19
 011D EB 00                                 JMP L1005
 011F                      L1001  EQU $
 011F 8B 45 F8                              MOV %EAX,[%EBP-8]
 0122 3D 13 00 00 00                        CMP %EAX,#19
 0127 75 00                                 JNE L1006
    85      print string("a * b // c * d is right associative and with equal precedence, i.e. a * (b // (c * d))"); newline
 0129 81 EC 00 01 00 00                     SUB %ESP,#256
 012F 89 E0                                 MOV %EAX,%ESP
 0131 50                                    PUSH %EAX
 0132 B8 35 01 00 00                        MOV %EAX,COT+#309
 0137 50                                    PUSH %EAX
 0138 68 FF 00 00 00                        PUSH #255
 013D E8 03 00                              CALL '_IMPSTRCPY' (EXTERN 3)
 0140 83 C4 0C                              ADD %ESP,#12
 0143 E8 3B 00                              CALL 'PRINTSTRING' (EXTERN 59)
 0146 81 C4 00 01 00 00                     ADD %ESP,#256
 014C E8 43 00                              CALL 'NEWLINE' (EXTERN 67)
    86      newline
 014F E8 43 00                              CALL 'NEWLINE' (EXTERN 67)
    87      print string("This grammar would support the above:"); newline
 0152 81 EC 00 01 00 00                     SUB %ESP,#256
 0158 89 E0                                 MOV %EAX,%ESP
 015A 50                                    PUSH %EAX
 015B B8 8C 01 00 00                        MOV %EAX,COT+#396
 0160 50                                    PUSH %EAX
 0161 68 FF 00 00 00                        PUSH #255
 0166 E8 03 00                              CALL '_IMPSTRCPY' (EXTERN 3)
 0169 83 C4 0C                              ADD %ESP,#12
 016C E8 3B 00                              CALL 'PRINTSTRING' (EXTERN 59)
 016F 81 C4 00 01 00 00                     ADD %ESP,#256
 0175 E8 43 00                              CALL 'NEWLINE' (EXTERN 67)
    88      newline
 0178 E8 43 00                              CALL 'NEWLINE' (EXTERN 67)
    89      print string("P<expr> = <term> <op-term-list> ;"); newline
 017B 81 EC 00 01 00 00                     SUB %ESP,#256
 0181 89 E0                                 MOV %EAX,%ESP
 0183 50                                    PUSH %EAX
 0184 B8 B2 01 00 00                        MOV %EAX,COT+#434
 0189 50                                    PUSH %EAX
 018A 68 FF 00 00 00                        PUSH #255
 018F E8 03 00                              CALL '_IMPSTRCPY' (EXTERN 3)
 0192 83 C4 0C                              ADD %ESP,#12
 0195 E8 3B 00                              CALL 'PRINTSTRING' (EXTERN 59)
 0198 81 C4 00 01 00 00                     ADD %ESP,#256
 019E E8 43 00                              CALL 'NEWLINE' (EXTERN 67)
    90      print string("P<op-term-list> = <op-term> <op-term-list> | ;"); newline
 01A1 81 EC 00 01 00 00                     SUB %ESP,#256
 01A7 89 E0                                 MOV %EAX,%ESP
 01A9 50                                    PUSH %EAX
 01AA B8 D4 01 00 00                        MOV %EAX,COT+#468
 01AF 50                                    PUSH %EAX
 01B0 68 FF 00 00 00                        PUSH #255
 01B5 E8 03 00                              CALL '_IMPSTRCPY' (EXTERN 3)
 01B8 83 C4 0C                              ADD %ESP,#12
 01BB E8 3B 00                              CALL 'PRINTSTRING' (EXTERN 59)
 01BE 81 C4 00 01 00 00                     ADD %ESP,#256
 01C4 E8 43 00                              CALL 'NEWLINE' (EXTERN 67)
    91      print string("P<op-term> = <op> <term> ;"); newline
 01C7 81 EC 00 01 00 00                     SUB %ESP,#256
 01CD 89 E0                                 MOV %EAX,%ESP
 01CF 50                                    PUSH %EAX
 01D0 B8 03 02 00 00                        MOV %EAX,COT+#515
 01D5 50                                    PUSH %EAX
 01D6 68 FF 00 00 00                        PUSH #255
 01DB E8 03 00                              CALL '_IMPSTRCPY' (EXTERN 3)
 01DE 83 C4 0C                              ADD %ESP,#12
 01E1 E8 3B 00                              CALL 'PRINTSTRING' (EXTERN 59)
 01E4 81 C4 00 01 00 00                     ADD %ESP,#256
 01EA E8 43 00                              CALL 'NEWLINE' (EXTERN 67)
    92    %else %if x = 192
 01ED EB 00                                 JMP L1005
 01EF                      L1006  EQU $
 01EF 8B 45 F8                              MOV %EAX,[%EBP-8]
 01F2 3D C0 00 00 00                        CMP %EAX,#192
 01F7 75 00                                 JNE L1007
    93      print string("a * b // c * d is left associative and with equal precedence, i.e. ((a * b) // c) * d"); newline
 01F9 81 EC 00 01 00 00                     SUB %ESP,#256
 01FF 89 E0                                 MOV %EAX,%ESP
 0201 50                                    PUSH %EAX
 0202 B8 1E 02 00 00                        MOV %EAX,COT+#542
 0207 50                                    PUSH %EAX
 0208 68 FF 00 00 00                        PUSH #255
 020D E8 03 00                              CALL '_IMPSTRCPY' (EXTERN 3)
 0210 83 C4 0C                              ADD %ESP,#12
 0213 E8 3B 00                              CALL 'PRINTSTRING' (EXTERN 59)
 0216 81 C4 00 01 00 00                     ADD %ESP,#256
 021C E8 43 00                              CALL 'NEWLINE' (EXTERN 67)
    94      newline
 021F E8 43 00                              CALL 'NEWLINE' (EXTERN 67)
    95      print string("This grammar would support the above:"); newline
 0222 81 EC 00 01 00 00                     SUB %ESP,#256
 0228 89 E0                                 MOV %EAX,%ESP
 022A 50                                    PUSH %EAX
 022B B8 74 02 00 00                        MOV %EAX,COT+#628
 0230 50                                    PUSH %EAX
 0231 68 FF 00 00 00                        PUSH #255
 0236 E8 03 00                              CALL '_IMPSTRCPY' (EXTERN 3)
 0239 83 C4 0C                              ADD %ESP,#12
 023C E8 3B 00                              CALL 'PRINTSTRING' (EXTERN 59)
 023F 81 C4 00 01 00 00                     ADD %ESP,#256
 0245 E8 43 00                              CALL 'NEWLINE' (EXTERN 67)
    96      newline
 0248 E8 43 00                              CALL 'NEWLINE' (EXTERN 67)
    97      print string("P<expr> = <term-op-list> <term> ;"); newline
 024B 81 EC 00 01 00 00                     SUB %ESP,#256
 0251 89 E0                                 MOV %EAX,%ESP
 0253 50                                    PUSH %EAX
 0254 B8 9A 02 00 00                        MOV %EAX,COT+#666
 0259 50                                    PUSH %EAX
 025A 68 FF 00 00 00                        PUSH #255
 025F E8 03 00                              CALL '_IMPSTRCPY' (EXTERN 3)
 0262 83 C4 0C                              ADD %ESP,#12
 0265 E8 3B 00                              CALL 'PRINTSTRING' (EXTERN 59)
 0268 81 C4 00 01 00 00                     ADD %ESP,#256
 026E E8 43 00                              CALL 'NEWLINE' (EXTERN 67)
    98      print string("P<term-op-list> = <term-op> <term-op-list> | ;"); newline
 0271 81 EC 00 01 00 00                     SUB %ESP,#256
 0277 89 E0                                 MOV %EAX,%ESP
 0279 50                                    PUSH %EAX
 027A B8 BC 02 00 00                        MOV %EAX,COT+#700
 027F 50                                    PUSH %EAX
 0280 68 FF 00 00 00                        PUSH #255
 0285 E8 03 00                              CALL '_IMPSTRCPY' (EXTERN 3)
 0288 83 C4 0C                              ADD %ESP,#12
 028B E8 3B 00                              CALL 'PRINTSTRING' (EXTERN 59)
 028E 81 C4 00 01 00 00                     ADD %ESP,#256
 0294 E8 43 00                              CALL 'NEWLINE' (EXTERN 67)
    99      print string("P<term-op> = <term> <op> ;"); newline
 0297 81 EC 00 01 00 00                     SUB %ESP,#256
 029D 89 E0                                 MOV %EAX,%ESP
 029F 50                                    PUSH %EAX
 02A0 B8 EB 02 00 00                        MOV %EAX,COT+#747
 02A5 50                                    PUSH %EAX
 02A6 68 FF 00 00 00                        PUSH #255
 02AB E8 03 00                              CALL '_IMPSTRCPY' (EXTERN 3)
 02AE 83 C4 0C                              ADD %ESP,#12
 02B1 E8 3B 00                              CALL 'PRINTSTRING' (EXTERN 59)
 02B4 81 C4 00 01 00 00                     ADD %ESP,#256
 02BA E8 43 00                              CALL 'NEWLINE' (EXTERN 67)
   100    %else
 02BD EB 00                                 JMP L1005
 02BF                      L1007  EQU $
   101      print string("a * b // c * d uses some weird non-standard combination of precedence and associativity!"); newline
 02BF 81 EC 00 01 00 00                     SUB %ESP,#256
 02C5 89 E0                                 MOV %EAX,%ESP
 02C7 50                                    PUSH %EAX
 02C8 B8 06 03 00 00                        MOV %EAX,COT+#774
 02CD 50                                    PUSH %EAX
 02CE 68 FF 00 00 00                        PUSH #255
 02D3 E8 03 00                              CALL '_IMPSTRCPY' (EXTERN 3)
 02D6 83 C4 0C                              ADD %ESP,#12
 02D9 E8 3B 00                              CALL 'PRINTSTRING' (EXTERN 59)
 02DC 81 C4 00 01 00 00                     ADD %ESP,#256
 02E2 E8 43 00                              CALL 'NEWLINE' (EXTERN 67)
   102    %finish
 02E5                      L1005  EQU $
   103    newline
 02E5 E8 43 00                              CALL 'NEWLINE' (EXTERN 67)
   104  
   105  
   106    %const %integer p = 4, q = 3, r = 2
   107    %integer y
   108  
   109    y = p ^^ q ^^ r
 02E8 C7 45 F4 00 10 00 00                  MOV DWORD PTR [%EBP-12],#4096
   110  
   111    %if y = 262144 %start
 02EF 8B 45 F4                              MOV %EAX,[%EBP-12]
 02F2 3D 00 00 04 00                        CMP %EAX,#262144
 02F7 75 00                                 JNE L1008
   112      print string("p ^^ q ^^ r is right associative, i.e. p ^^ (q ^^ r)"); newline
 02F9 81 EC 00 01 00 00                     SUB %ESP,#256
 02FF 89 E0                                 MOV %EAX,%ESP
 0301 50                                    PUSH %EAX
 0302 B8 5F 03 00 00                        MOV %EAX,COT+#863
 0307 50                                    PUSH %EAX
 0308 68 FF 00 00 00                        PUSH #255
 030D E8 03 00                              CALL '_IMPSTRCPY' (EXTERN 3)
 0310 83 C4 0C                              ADD %ESP,#12
 0313 E8 3B 00                              CALL 'PRINTSTRING' (EXTERN 59)
 0316 81 C4 00 01 00 00                     ADD %ESP,#256
 031C E8 43 00                              CALL 'NEWLINE' (EXTERN 67)
   113      newline
 031F E8 43 00                              CALL 'NEWLINE' (EXTERN 67)
   114      print string("This grammar would support the above:"); newline
 0322 81 EC 00 01 00 00                     SUB %ESP,#256
 0328 89 E0                                 MOV %EAX,%ESP
 032A 50                                    PUSH %EAX
 032B B8 94 03 00 00                        MOV %EAX,COT+#916
 0330 50                                    PUSH %EAX
 0331 68 FF 00 00 00                        PUSH #255
 0336 E8 03 00                              CALL '_IMPSTRCPY' (EXTERN 3)
 0339 83 C4 0C                              ADD %ESP,#12
 033C E8 3B 00                              CALL 'PRINTSTRING' (EXTERN 59)
 033F 81 C4 00 01 00 00                     ADD %ESP,#256
 0345 E8 43 00                              CALL 'NEWLINE' (EXTERN 67)
   115      newline
 0348 E8 43 00                              CALL 'NEWLINE' (EXTERN 67)
   116      print string("P<expr> = <term> <exp-term-list> ;"); newline
 034B 81 EC 00 01 00 00                     SUB %ESP,#256
 0351 89 E0                                 MOV %EAX,%ESP
 0353 50                                    PUSH %EAX
 0354 B8 BA 03 00 00                        MOV %EAX,COT+#954
 0359 50                                    PUSH %EAX
 035A 68 FF 00 00 00                        PUSH #255
 035F E8 03 00                              CALL '_IMPSTRCPY' (EXTERN 3)
 0362 83 C4 0C                              ADD %ESP,#12
 0365 E8 3B 00                              CALL 'PRINTSTRING' (EXTERN 59)
 0368 81 C4 00 01 00 00                     ADD %ESP,#256
 036E E8 43 00                              CALL 'NEWLINE' (EXTERN 67)
   117      print string("P<exp-term-list> = <exp-term> <exp-term-list> | ;"); newline
 0371 81 EC 00 01 00 00                     SUB %ESP,#256
 0377 89 E0                                 MOV %EAX,%ESP
 0379 50                                    PUSH %EAX
 037A B8 DD 03 00 00                        MOV %EAX,COT+#989
 037F 50                                    PUSH %EAX
 0380 68 FF 00 00 00                        PUSH #255
 0385 E8 03 00                              CALL '_IMPSTRCPY' (EXTERN 3)
 0388 83 C4 0C                              ADD %ESP,#12
 038B E8 3B 00                              CALL 'PRINTSTRING' (EXTERN 59)
 038E 81 C4 00 01 00 00                     ADD %ESP,#256
 0394 E8 43 00                              CALL 'NEWLINE' (EXTERN 67)
   118      print string("P<exp-term> = ""^^"" <term> ;"); newline
 0397 81 EC 00 01 00 00                     SUB %ESP,#256
 039D 89 E0                                 MOV %EAX,%ESP
 039F 50                                    PUSH %EAX
 03A0 B8 0F 04 00 00                        MOV %EAX,COT+#1039
 03A5 50                                    PUSH %EAX
 03A6 68 FF 00 00 00                        PUSH #255
 03AB E8 03 00                              CALL '_IMPSTRCPY' (EXTERN 3)
 03AE 83 C4 0C                              ADD %ESP,#12
 03B1 E8 3B 00                              CALL 'PRINTSTRING' (EXTERN 59)
 03B4 81 C4 00 01 00 00                     ADD %ESP,#256
 03BA E8 43 00                              CALL 'NEWLINE' (EXTERN 67)
   119    %else %if y = 4096
 03BD EB 00                                 JMP L1009
 03BF                      L1008  EQU $
 03BF 8B 45 F4                              MOV %EAX,[%EBP-12]
 03C2 3D 00 10 00 00                        CMP %EAX,#4096
 03C7 75 00                                 JNE L1010
   120      print string("p ^^ q ^^ r is left associative, i.e. (p ^^ q) ^^ r"); newline
 03C9 81 EC 00 01 00 00                     SUB %ESP,#256
 03CF 89 E0                                 MOV %EAX,%ESP
 03D1 50                                    PUSH %EAX
 03D2 B8 2B 04 00 00                        MOV %EAX,COT+#1067
 03D7 50                                    PUSH %EAX
 03D8 68 FF 00 00 00                        PUSH #255
 03DD E8 03 00                              CALL '_IMPSTRCPY' (EXTERN 3)
 03E0 83 C4 0C                              ADD %ESP,#12
 03E3 E8 3B 00                              CALL 'PRINTSTRING' (EXTERN 59)
 03E6 81 C4 00 01 00 00                     ADD %ESP,#256
 03EC E8 43 00                              CALL 'NEWLINE' (EXTERN 67)
   121      newline
 03EF E8 43 00                              CALL 'NEWLINE' (EXTERN 67)
   122      print string("This grammar would support the above:"); newline
 03F2 81 EC 00 01 00 00                     SUB %ESP,#256
 03F8 89 E0                                 MOV %EAX,%ESP
 03FA 50                                    PUSH %EAX
 03FB B8 5F 04 00 00                        MOV %EAX,COT+#1119
 0400 50                                    PUSH %EAX
 0401 68 FF 00 00 00                        PUSH #255
 0406 E8 03 00                              CALL '_IMPSTRCPY' (EXTERN 3)
 0409 83 C4 0C                              ADD %ESP,#12
 040C E8 3B 00                              CALL 'PRINTSTRING' (EXTERN 59)
 040F 81 C4 00 01 00 00                     ADD %ESP,#256
 0415 E8 43 00                              CALL 'NEWLINE' (EXTERN 67)
   123      newline
 0418 E8 43 00                              CALL 'NEWLINE' (EXTERN 67)
   124      print string("P<expr> = <term-exp-list> <term> ;"); newline
 041B 81 EC 00 01 00 00                     SUB %ESP,#256
 0421 89 E0                                 MOV %EAX,%ESP
 0423 50                                    PUSH %EAX
 0424 B8 85 04 00 00                        MOV %EAX,COT+#1157
 0429 50                                    PUSH %EAX
 042A 68 FF 00 00 00                        PUSH #255
 042F E8 03 00                              CALL '_IMPSTRCPY' (EXTERN 3)
 0432 83 C4 0C                              ADD %ESP,#12
 0435 E8 3B 00                              CALL 'PRINTSTRING' (EXTERN 59)
 0438 81 C4 00 01 00 00                     ADD %ESP,#256
 043E E8 43 00                              CALL 'NEWLINE' (EXTERN 67)
   125      print string("P<term-exp-list> = <term-exp> <term-exp-list> | ;"); newline
 0441 81 EC 00 01 00 00                     SUB %ESP,#256
 0447 89 E0                                 MOV %EAX,%ESP
 0449 50                                    PUSH %EAX
 044A B8 A8 04 00 00                        MOV %EAX,COT+#1192
 044F 50                                    PUSH %EAX
 0450 68 FF 00 00 00                        PUSH #255
 0455 E8 03 00                              CALL '_IMPSTRCPY' (EXTERN 3)
 0458 83 C4 0C                              ADD %ESP,#12
 045B E8 3B 00                              CALL 'PRINTSTRING' (EXTERN 59)
 045E 81 C4 00 01 00 00                     ADD %ESP,#256
 0464 E8 43 00                              CALL 'NEWLINE' (EXTERN 67)
   126      print string("P<term-exp> = <term> ""^^"" ;"); newline
 0467 81 EC 00 01 00 00                     SUB %ESP,#256
 046D 89 E0                                 MOV %EAX,%ESP
 046F 50                                    PUSH %EAX
 0470 B8 DA 04 00 00                        MOV %EAX,COT+#1242
 0475 50                                    PUSH %EAX
 0476 68 FF 00 00 00                        PUSH #255
 047B E8 03 00                              CALL '_IMPSTRCPY' (EXTERN 3)
 047E 83 C4 0C                              ADD %ESP,#12
 0481 E8 3B 00                              CALL 'PRINTSTRING' (EXTERN 59)
 0484 81 C4 00 01 00 00                     ADD %ESP,#256
 048A E8 43 00                              CALL 'NEWLINE' (EXTERN 67)
   127    %else
 048D EB 00                                 JMP L1009
 048F                      L1010  EQU $
   128      print string("p ^^ q ^^ r is something weird! ("); write(y, 0); print string(") - I give up."); newline
 048F 81 EC 00 01 00 00                     SUB %ESP,#256
 0495 89 E0                                 MOV %EAX,%ESP
 0497 50                                    PUSH %EAX
 0498 B8 F6 04 00 00                        MOV %EAX,COT+#1270
 049D 50                                    PUSH %EAX
 049E 68 FF 00 00 00                        PUSH #255
 04A3 E8 03 00                              CALL '_IMPSTRCPY' (EXTERN 3)
 04A6 83 C4 0C                              ADD %ESP,#12
 04A9 E8 3B 00                              CALL 'PRINTSTRING' (EXTERN 59)
 04AC 81 C4 00 01 00 00                     ADD %ESP,#256
 04B2 FF 75 F4                              PUSH DWORD PTR [%EBP-12]
 04B5 6A 00                                 PUSH #0
 04B7 E8 40 00                              CALL 'WRITE' (EXTERN 64)
 04BA 83 C4 08                              ADD %ESP,#8
 04BD 81 EC 00 01 00 00                     SUB %ESP,#256
 04C3 89 E0                                 MOV %EAX,%ESP
 04C5 50                                    PUSH %EAX
 04C6 B8 18 05 00 00                        MOV %EAX,COT+#1304
 04CB 50                                    PUSH %EAX
 04CC 68 FF 00 00 00                        PUSH #255
 04D1 E8 03 00                              CALL '_IMPSTRCPY' (EXTERN 3)
 04D4 83 C4 0C                              ADD %ESP,#12
 04D7 E8 3B 00                              CALL 'PRINTSTRING' (EXTERN 59)
 04DA 81 C4 00 01 00 00                     ADD %ESP,#256
 04E0 E8 43 00                              CALL 'NEWLINE' (EXTERN 67)
   129    %finish
 04E3                      L1009  EQU $
   130    newline
 04E3 E8 43 00                              CALL 'NEWLINE' (EXTERN 67)
   131  
   132  ! The remaining issue to be checked is how left/right associativity interact when the precedence is the same,
   133  ! which is only the case for exponentiation and shifts together, eg
   134  !
   135  ! a << b << c ^^ d ^^ e   or   a ^^ b ^^ c >> d >> e
   136  !
   137  
   138  %endofprogram
 04E6 C9                                    LEAVE
 04E7 C3                                    RET
