         Edinburgh IMP77 Compiler - Version 8.4-2024.12.18

     1  %externalroutine toplev
 0000                      L1000  EQU $
 0000 C8 00 00 01                           ENTER 0000,1
     2  
     3  ! compiled with ./imps this gives a segfault but with ./bin/imps it compiles OK???!
     4  ! what in the prims.inc could cause that?
     5  
     6    %longreal lr1
     7    %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
     8    
     9    %if i2 = i3 %start
 0019 8B 45 E8                              MOV %EAX,[%EBP-24]
 001C 3B 45 E4                              CMP %EAX,[%EBP-28]
 001F 75 00                                 JNE L1001
    10        i = i1
 0021 8B 45 EC                              MOV %EAX,[%EBP-20]
 0024 89 45 F0                              MOV [%EBP-16],%EAX
    11    %finish
 0027                      L1001  EQU $
    12  
    13    test3else:
 0027                      L1002  EQU $
    14  
    15    %if i2 = i3 %then i = i1 %else i = i2
 0027 8B 45 E8                              MOV %EAX,[%EBP-24]
 002A 3B 45 E4                              CMP %EAX,[%EBP-28]
 002D 75 00                                 JNE L1003
 002F 8B 45 EC                              MOV %EAX,[%EBP-20]
 0032 89 45 F0                              MOV [%EBP-16],%EAX
 0035 EB 00                                 JMP L1004
 0037                      L1003  EQU $
 0037 8B 45 E8                              MOV %EAX,[%EBP-24]
 003A 89 45 F0                              MOV [%EBP-16],%EAX
 003D                      L1004  EQU $
    16  
    17    test4else:
 003D                      L1005  EQU $
    18  
    19    %if i2 = i3 %then %start
 003D 8B 45 E8                              MOV %EAX,[%EBP-24]
 0040 3B 45 E4                              CMP %EAX,[%EBP-28]
 0043 75 00                                 JNE L1006
    20        i = i1
 0045 8B 45 EC                              MOV %EAX,[%EBP-20]
 0048 89 45 F0                              MOV [%EBP-16],%EAX
    21    %finish %else i = i2
 004B EB 00                                 JMP L1007
 004D                      L1006  EQU $
 004D 8B 45 E8                              MOV %EAX,[%EBP-24]
 0050 89 45 F0                              MOV [%EBP-16],%EAX
 0053                      L1007  EQU $
    22          
    23  %end
 0053 C9                                    LEAVE
 0054 C3                                    RET
?TEST4ELSE unused
?TEST3ELSE unused
?LR1 unused
    24  %endoffile

    12 Statements compiled



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


