         Edinburgh IMP77 Compiler - Version 8.4-2024.12.18

     1  %externalroutine toplev
 0000                      L1000  EQU $
 0000 C8 00 00 01                           ENTER 0000,1
     2    %longreal lr1
     3    %integer i, i1 = 1, i2 = 2, i3 = 3
 0004 C7 45 EC 01 00 00 00                  MOV DWORD PTR [%EBP-20],#1
 000B C7 45 E8 02 00 00 00                  MOV DWORD PTR [%EBP-24],#2
 0012 C7 45 E4 03 00 00 00                  MOV DWORD PTR [%EBP-28],#3
     4  
     5    i = i1 %while i2 = i3
 0019                      L1001  EQU $
 0019 8B 45 E8                              MOV %EAX,[%EBP-24]
 001C 3B 45 E4                              CMP %EAX,[%EBP-28]
 001F 75 00                                 JNE L1002
 0021 8B 45 EC                              MOV %EAX,[%EBP-20]
 0024 89 45 F0                              MOV [%EBP-16],%EAX
 0027 EB 00                                 JMP L1001
 0029                      L1002  EQU $
     6    i = i1 %until i2 = i3
 0029                      L1003  EQU $
 0029 8B 45 EC                              MOV %EAX,[%EBP-20]
 002C 89 45 F0                              MOV [%EBP-16],%EAX
 002F 8B 45 E8                              MOV %EAX,[%EBP-24]
 0032 3B 45 E4                              CMP %EAX,[%EBP-28]
 0035 74 00                                 JE L1004
 0037 EB 00                                 JMP L1003
 0039                      L1004  EQU $
     7    i = i1 %for i2 = i3, 1, i1
 0039 8B 45 EC                              MOV %EAX,[%EBP-20]
 003C 89 45 E0                              MOV [%EBP-32],%EAX
 003F 8B 45 E4                              MOV %EAX,[%EBP-28]
 0042 48                                    DEC %EAX
 0043 89 45 E8                              MOV [%EBP-24],%EAX
 0046                      L1005  EQU $
 0046 8B 45 E8                              MOV %EAX,[%EBP-24]
 0049 3B 45 E0                              CMP %EAX,[%EBP-32]
 004C 74 00                                 JE L1006
 004E 40                                    INC %EAX
 004F 89 45 E8                              MOV [%EBP-24],%EAX
 0052 8B 45 EC                              MOV %EAX,[%EBP-20]
 0055 89 45 F0                              MOV [%EBP-16],%EAX
 0058 EB 00                                 JMP L1005
 005A                      L1006  EQU $
     8  
     9    %while i2 = i3 %then i = i1
 005A                      L1007  EQU $
 005A 8B 45 E8                              MOV %EAX,[%EBP-24]
 005D 3B 45 E4                              CMP %EAX,[%EBP-28]
 0060 75 00                                 JNE L1008
 0062 8B 45 EC                              MOV %EAX,[%EBP-20]
 0065 89 45 F0                              MOV [%EBP-16],%EAX
 0068 EB 00                                 JMP L1007
 006A                      L1008  EQU $
    10    ! ILLEGAL IMP77: %until i2 = i3 %then i = i1
    11  
    12    ! This is legal Imp77 but my parser doesn't accept it.  FIX IT.
    13    !%for i2 = i3, 1, i1 %then i = i1
    14  
    15    %while i1 = i2 %cycle
 006A                      L1009  EQU $
 006A 8B 45 EC                              MOV %EAX,[%EBP-20]
 006D 3B 45 E8                              CMP %EAX,[%EBP-24]
 0070 75 00                                 JNE L1010
    16      i = i1
 0072 8B 45 EC                              MOV %EAX,[%EBP-20]
 0075 89 45 F0                              MOV [%EBP-16],%EAX
    17    %repeat
 0078 EB 00                                 JMP L1009
 007A                      L1010  EQU $
    18  
    19    ! ILLEGAL IMP77:
    20    !%until i1 = i2 %cycle
    21    !  i = i1
    22    !%repeat
    23  
    24    %cycle
 007A                      L1011  EQU $
    25      i = i1
 007A 8B 45 EC                              MOV %EAX,[%EBP-20]
 007D 89 45 F0                              MOV [%EBP-16],%EAX
    26    %repeat %until i1 = i2
 0080 8B 45 EC                              MOV %EAX,[%EBP-20]
 0083 3B 45 E8                              CMP %EAX,[%EBP-24]
 0086 74 00                                 JE L1012
 0088 EB 00                                 JMP L1011
 008A                      L1012  EQU $
    27  
    28    %for i2 = i3, 1, i1 %cycle
 008A 8B 45 EC                              MOV %EAX,[%EBP-20]
 008D 89 45 DC                              MOV [%EBP-36],%EAX
 0090 8B 45 E4                              MOV %EAX,[%EBP-28]
 0093 48                                    DEC %EAX
 0094 89 45 E8                              MOV [%EBP-24],%EAX
 0097                      L1013  EQU $
 0097 8B 45 E8                              MOV %EAX,[%EBP-24]
 009A 3B 45 DC                              CMP %EAX,[%EBP-36]
 009D 74 00                                 JE L1014
 009F 40                                    INC %EAX
 00A0 89 45 E8                              MOV [%EBP-24],%EAX
    29      i = i1
 00A3 8B 45 EC                              MOV %EAX,[%EBP-20]
 00A6 89 45 F0                              MOV [%EBP-16],%EAX
    30    %repeat
 00A9 EB 00                                 JMP L1013
 00AB                      L1014  EQU $
    31  
    32    %while i1 = i2 %cycle
 00AB                      L1015  EQU $
 00AB 8B 45 EC                              MOV %EAX,[%EBP-20]
 00AE 3B 45 E8                              CMP %EAX,[%EBP-24]
 00B1 75 00                                 JNE L1016
    33      i = i1
 00B3 8B 45 EC                              MOV %EAX,[%EBP-20]
 00B6 89 45 F0                              MOV [%EBP-16],%EAX
    34    %repeat;! temp disabled: %until i2 = i3
 00B9 EB 00                                 JMP L1015
 00BB                      L1016  EQU $
    35  
    36    ! ILLEGAL IMP77:
    37    !%until i1 = i2 %cycle
    38    !  i = i1
    39    !%repeat %until i2 = i3
    40  
    41  lab7:
 00BB                      L1017  EQU $
    42  
    43    %for i2 = i3, 1, i1 %cycle
 00BB 8B 45 EC                              MOV %EAX,[%EBP-20]
 00BE 89 45 D8                              MOV [%EBP-40],%EAX
 00C1 8B 45 E4                              MOV %EAX,[%EBP-28]
 00C4 48                                    DEC %EAX
 00C5 89 45 E8                              MOV [%EBP-24],%EAX
 00C8                      L1018  EQU $
 00C8 8B 45 E8                              MOV %EAX,[%EBP-24]
 00CB 3B 45 D8                              CMP %EAX,[%EBP-40]
 00CE 74 00                                 JE L1019
 00D0 40                                    INC %EAX
 00D1 89 45 E8                              MOV [%EBP-24],%EAX
    44      i = i1
 00D4 8B 45 EC                              MOV %EAX,[%EBP-20]
 00D7 89 45 F0                              MOV [%EBP-16],%EAX
    45    %repeat;! temp disabled: %until i2 = i3
 00DA EB 00                                 JMP L1018
 00DC                      L1019  EQU $
    46  
    47  
    48  
    49  
    50    i = i1 %and i1 = i2 %while i2 = i3
 00DC                      L1020  EQU $
 00DC 8B 45 E8                              MOV %EAX,[%EBP-24]
 00DF 3B 45 E4                              CMP %EAX,[%EBP-28]
 00E2 75 00                                 JNE L1021
 00E4 8B 45 EC                              MOV %EAX,[%EBP-20]
 00E7 89 45 F0                              MOV [%EBP-16],%EAX
 00EA 8B 45 E8                              MOV %EAX,[%EBP-24]
 00ED 89 45 EC                              MOV [%EBP-20],%EAX
 00F0 EB 00                                 JMP L1020
 00F2                      L1021  EQU $
    51    i = i1 %and i1 = i2 %until i2 = i3
 00F2                      L1022  EQU $
 00F2 8B 45 EC                              MOV %EAX,[%EBP-20]
 00F5 89 45 F0                              MOV [%EBP-16],%EAX
 00F8 8B 45 E8                              MOV %EAX,[%EBP-24]
 00FB 89 45 EC                              MOV [%EBP-20],%EAX
 00FE 8B 45 E8                              MOV %EAX,[%EBP-24]
 0101 3B 45 E4                              CMP %EAX,[%EBP-28]
 0104 74 00                                 JE L1023
 0106 EB 00                                 JMP L1022
 0108                      L1023  EQU $
    52  
    53  lab3:
 0108                      L1024  EQU $
    54  
    55    i = i1 %and i1 = i2 %for i2 = i3, 1, i1
 0108 8B 45 EC                              MOV %EAX,[%EBP-20]
 010B 89 45 D4                              MOV [%EBP-44],%EAX
 010E 8B 45 E4                              MOV %EAX,[%EBP-28]
 0111 48                                    DEC %EAX
 0112 89 45 E8                              MOV [%EBP-24],%EAX
 0115                      L1025  EQU $
 0115 8B 45 E8                              MOV %EAX,[%EBP-24]
 0118 3B 45 D4                              CMP %EAX,[%EBP-44]
 011B 74 00                                 JE L1026
 011D 40                                    INC %EAX
 011E 89 45 E8                              MOV [%EBP-24],%EAX
 0121 8B 45 EC                              MOV %EAX,[%EBP-20]
 0124 89 45 F0                              MOV [%EBP-16],%EAX
 0127 8B 45 E8                              MOV %EAX,[%EBP-24]
 012A 89 45 EC                              MOV [%EBP-20],%EAX
 012D EB 00                                 JMP L1025
 012F                      L1026  EQU $
    56  
    57  lab4:
 012F                      L1027  EQU $
    58  
    59    %while i2 = i3 %then i = i1 %and i1 = i2
 012F                      L1028  EQU $
 012F 8B 45 E8                              MOV %EAX,[%EBP-24]
 0132 3B 45 E4                              CMP %EAX,[%EBP-28]
 0135 75 00                                 JNE L1029
 0137 8B 45 EC                              MOV %EAX,[%EBP-20]
 013A 89 45 F0                              MOV [%EBP-16],%EAX
 013D 8B 45 E8                              MOV %EAX,[%EBP-24]
 0140 89 45 EC                              MOV [%EBP-20],%EAX
 0143 EB 00                                 JMP L1028
 0145                      L1029  EQU $
    60    ! ILLEGAL IMP77: %until i2 = i3 %then i = i1 %and i1 = i2
    61  
    62  lab5:
 0145                      L1030  EQU $
    63  
    64    ! This is legal Imp77 but my parser doesn't accept it.  FIX IT.
    65    !%for i2 = i3, 1, i1 %then i = i1 %and i1 = i2
    66  
    67    %while i1 = i2 %cycle
 0145                      L1031  EQU $
 0145 8B 45 EC                              MOV %EAX,[%EBP-20]
 0148 3B 45 E8                              CMP %EAX,[%EBP-24]
 014B 75 00                                 JNE L1032
    68      i = i1 ; i1 = i2
 014D 8B 45 EC                              MOV %EAX,[%EBP-20]
 0150 89 45 F0                              MOV [%EBP-16],%EAX
 0153 8B 45 E8                              MOV %EAX,[%EBP-24]
 0156 89 45 EC                              MOV [%EBP-20],%EAX
    69    %repeat
 0159 EB 00                                 JMP L1031
 015B                      L1032  EQU $
    70  
    71    ! ILLEGAL IMP77:
    72    !%until i1 = i2 %cycle
    73    !  i = i1 ; i1 = i2
    74    !%repeat
    75  
    76  lab6:
 015B                      L1033  EQU $
    77  
    78    %cycle
 015B                      L1034  EQU $
    79      i = i1 ; i1 = i2
 015B 8B 45 EC                              MOV %EAX,[%EBP-20]
 015E 89 45 F0                              MOV [%EBP-16],%EAX
 0161 8B 45 E8                              MOV %EAX,[%EBP-24]
 0164 89 45 EC                              MOV [%EBP-20],%EAX
    80    %repeat %until i1 = i2
 0167 8B 45 EC                              MOV %EAX,[%EBP-20]
 016A 3B 45 E8                              CMP %EAX,[%EBP-24]
 016D 74 00                                 JE L1035
 016F EB 00                                 JMP L1034
 0171                      L1035  EQU $
    81  
    82  lab2:
 0171                      L1036  EQU $
    83  
    84    %for i2 = i3, 1, i1 %cycle
 0171 8B 45 EC                              MOV %EAX,[%EBP-20]
 0174 89 45 D0                              MOV [%EBP-48],%EAX
 0177 8B 45 E4                              MOV %EAX,[%EBP-28]
 017A 48                                    DEC %EAX
 017B 89 45 E8                              MOV [%EBP-24],%EAX
 017E                      L1037  EQU $
 017E 8B 45 E8                              MOV %EAX,[%EBP-24]
 0181 3B 45 D0                              CMP %EAX,[%EBP-48]
 0184 74 00                                 JE L1038
 0186 40                                    INC %EAX
 0187 89 45 E8                              MOV [%EBP-24],%EAX
    85      i = i1 ; i1 = i2
 018A 8B 45 EC                              MOV %EAX,[%EBP-20]
 018D 89 45 F0                              MOV [%EBP-16],%EAX
 0190 8B 45 E8                              MOV %EAX,[%EBP-24]
 0193 89 45 EC                              MOV [%EBP-20],%EAX
    86    %repeat
 0196 EB 00                                 JMP L1037
 0198                      L1038  EQU $
    87  
    88    %while i1 = i2 %cycle
 0198                      L1039  EQU $
 0198 8B 45 EC                              MOV %EAX,[%EBP-20]
 019B 3B 45 E8                              CMP %EAX,[%EBP-24]
 019E 75 00                                 JNE L1040
    89      i = i1 ; i1 = i2
 01A0 8B 45 EC                              MOV %EAX,[%EBP-20]
 01A3 89 45 F0                              MOV [%EBP-16],%EAX
 01A6 8B 45 E8                              MOV %EAX,[%EBP-24]
 01A9 89 45 EC                              MOV [%EBP-20],%EAX
    90    %repeat;! temp disabled: %until i2 = i3
 01AC EB 00                                 JMP L1039
 01AE                      L1040  EQU $
    91  
    92    ! ILLEGAL IMP77:
    93    !%until i1 = i2 %cycle
    94    !  i = i1 ; i1 = i2
    95    !%repeat %until i2 = i3
    96  
    97  lab1:
 01AE                      L1041  EQU $
    98  
    99    %for i2 = i3, 1, i1 %cycle
 01AE 8B 45 EC                              MOV %EAX,[%EBP-20]
 01B1 89 45 CC                              MOV [%EBP-52],%EAX
 01B4 8B 45 E4                              MOV %EAX,[%EBP-28]
 01B7 48                                    DEC %EAX
 01B8 89 45 E8                              MOV [%EBP-24],%EAX
 01BB                      L1042  EQU $
 01BB 8B 45 E8                              MOV %EAX,[%EBP-24]
 01BE 3B 45 CC                              CMP %EAX,[%EBP-52]
 01C1 74 00                                 JE L1043
 01C3 40                                    INC %EAX
 01C4 89 45 E8                              MOV [%EBP-24],%EAX
   100      i = i1 ; i1 = i2
 01C7 8B 45 EC                              MOV %EAX,[%EBP-20]
 01CA 89 45 F0                              MOV [%EBP-16],%EAX
 01CD 8B 45 E8                              MOV %EAX,[%EBP-24]
 01D0 89 45 EC                              MOV [%EBP-20],%EAX
   101    %repeat;! temp disabled: %until i2 = i3
 01D3 EB 00                                 JMP L1042
 01D5                      L1043  EQU $
   102  
   103  %end
 01D5 C9                                    LEAVE
 01D6 C3                                    RET
?LAB1 unused
?LAB2 unused
?LAB6 unused
?LAB5 unused
?LAB4 unused
?LAB3 unused
?LAB7 unused
?LR1 unused
   104  %endoffile

    48 Statements compiled



 ELF object file generated from IMP source file: '/home/gtoal/src/compilers101/new-parser/imps/tests/test14.imp'
 +----------+---------------------+---------+---------+---------+------------+
 | Sections |       Symbols       | Code    | Data    | Diag    | Total size |
 +----------+----------+----------+---------+---------+---------+------------+
 |  (count) | Internal | External | (bytes) | (bytes) | (bytes) | (bytes)    |
 +----------+----------+----------+---------+---------+---------+------------+
 |       11 |        4 |        6 |     471 |       0 |      32 |        503 |
 +----------+----------+----------+---------+---------+---------+------------+


