         Edinburgh IMP77 Compiler - Version 8.4-2024.12.18

     1  %begin
 0000 C8 00 00 01                           ENTER 0000,1
     2    %owninteger      io
     3    %integer         i
     4    %integername     in
     5    %externalinteger ie
     6    %integerarray    ia(0:9)
 0004 C7 45 E4 01 00 00 00                  MOV DWORD PTR [%EBP-28],#1
 000B C7 45 E8 00 00 00 00                  MOV DWORD PTR [%EBP-24],#0
 0012 C7 45 EC 09 00 00 00                  MOV DWORD PTR [%EBP-20],#9
 0019 C7 45 F0 83 00 00 00                  MOV DWORD PTR [%EBP-16],#131
 0020 8D 45 E4                              LEA %EAX,[%EBP-28]
 0023 50                                    PUSH %EAX
 0024 E8 0A 00                              CALL '_IMPADEF' (EXTERN 10)
 0027 83 C4 04                              ADD %ESP,#4
 002A 8D 4D E4                              LEA %ECX,[%EBP-28]
 002D 89 E3                                 MOV %EBX,%ESP
 002F 29 D3                                 SUB %EBX,%EDX
 0031 89 5D DC                              MOV [%EBP-36],%EBX
 0034 89 4D E0                              MOV [%EBP-32],%ECX
 0037 01 C3                                 ADD %EBX,%EAX
 0039 89 DC                                 MOV %ESP,%EBX
     7    %integerfn       ifn(%integer i)
 003B EB 00                                 JMP L1001
 003D                      L1002  EQU $
 003D C8 00 00 02                           ENTER 0000,2
     8      %result = 1
 0041 B8 01 00 00 00                        MOV %EAX,#1
 0046 C9                                    LEAVE
 0047 C3                                    RET
     9    %end
 0048                      L1001  EQU $
?I unused
    10    %integerfn       ifn2
    11      %result = 1
 0048                      L1003  EQU $
 0048 C8 00 00 02                           ENTER 0000,2
 004C B8 01 00 00 00                        MOV %EAX,#1
 0051 C9                                    LEAVE
 0052 C3                                    RET
    12    %end
 0053                      L1001  EQU $
    13    %integermap      im(%integer i)
    14      %result ==  io
 0053                      L1004  EQU $
 0053 C8 00 00 02                           ENTER 0000,2
 0057 B8 00 00 00 00                        MOV %EAX,DATA+#0
 005C C9                                    LEAVE
 005D C3                                    RET
    15    %end
 005E                      L1001  EQU $
?I unused
    16    %integermap      im2
    17      %result ==  io
 005E                      L1005  EQU $
 005E C8 00 00 02                           ENTER 0000,2
 0062 B8 00 00 00 00                        MOV %EAX,DATA+#0
 0067 C9                                    LEAVE
 0068 C3                                    RET
    18    %end
 0069                      L1001  EQU $
    19    %routine         ir(%integer n)
    20    %end
 0069                      L1006  EQU $
 0069 C8 00 00 02                           ENTER 0000,2
 006D C9                                    LEAVE
 006E C3                                    RET
 006F                      L1001  EQU $
?N unused
    21    %recordformat    rf(%integer i)
    22    %recordformat    rfa(%integerarray ia(0:9))
    23    %record(rfa)%map   rm
 006F                      L1007  EQU $
 006F C8 00 00 02                           ENTER 0000,2
    24      %ownrecord(rfa) orec
    25      %result == orec
 0073 B8 08 00 00 00                        MOV %EAX,DATA+#8
 0078 C9                                    LEAVE
 0079 C3                                    RET
    26    %end
 007A                      L1001  EQU $
    27    %record(rf)%array  rec(0:9)
    28    %switch          sw(0:9)
 007A C7 45 CC 01 00 00 00                  MOV DWORD PTR [%EBP-52],#1
 0081 C7 45 D0 00 00 00 00                  MOV DWORD PTR [%EBP-48],#0
 0088 C7 45 D4 09 00 00 00                  MOV DWORD PTR [%EBP-44],#9
 008F C7 45 D8 89 00 00 00                  MOV DWORD PTR [%EBP-40],#137
 0096 8D 45 CC                              LEA %EAX,[%EBP-52]
 0099 50                                    PUSH %EAX
 009A E8 0A 00                              CALL '_IMPADEF' (EXTERN 10)
 009D 83 C4 04                              ADD %ESP,#4
 00A0 8D 4D CC                              LEA %ECX,[%EBP-52]
 00A3 89 E3                                 MOV %EBX,%ESP
 00A5 29 D3                                 SUB %EBX,%EDX
 00A7 89 5D C4                              MOV [%EBP-60],%EBX
 00AA 89 4D C8                              MOV [%EBP-56],%ECX
 00AD 01 C3                                 ADD %EBX,%EAX
 00AF 89 DC                                 MOV %ESP,%EBX
    29    
    30    sw(1):
 00B1                      L1008  EQU $
    31    %comment sw(1):
    32  
    33    io = 1
 00B1 C7 05 00 00 00 00 01 00 00 00         MOV DWORD PTR [DATA+0000],#1
    34    %comment io = 1
    35  
    36    ie = 1
 00BB C7 05 04 00 00 00 01 00 00 00         MOV DWORD PTR [DATA+0004],#1
    37    %comment ie = 1
    38    
    39    ia(1) = 1
 00C5 6A 01                                 PUSH #1
 00C7 FF 75 E0                              PUSH DWORD PTR [%EBP-32]
 00CA E8 09 00                              CALL '_IMPAREF' (EXTERN 9)
 00CD 83 C4 08                              ADD %ESP,#8
 00D0 89 C6                                 MOV %ESI,%EAX
 00D2 03 75 DC                              ADD %ESI,[%EBP-36]
 00D5 C7 06 01 00 00 00                     MOV DWORD PTR [%ESI],#1
    40    %comment ia(1) = 1
    41    
    42    i = ifn(1)
 00DB 6A 01                                 PUSH #1
 00DD E8 00 00                              CALL 'IFN' (INTERNAL L1002 )
 00E0 83 C4 04                              ADD %ESP,#4
 00E3 89 45 F8                              MOV [%EBP-8],%EAX
    43    %comment i = ifn(1)
    44    
    45    i = ifn2
 00E6 E8 00 00                              CALL 'IFN2' (INTERNAL L1003 )
 00E9 89 45 F8                              MOV [%EBP-8],%EAX
    46    %comment i = ifn2
    47    
    48    i = im(1)
 00EC 6A 01                                 PUSH #1
 00EE E8 00 00                              CALL 'IM' (INTERNAL L1004 )
 00F1 83 C4 04                              ADD %ESP,#4
 00F4 8B 00                                 MOV %EAX,[%EAX]
 00F6 89 45 F8                              MOV [%EBP-8],%EAX
    49    %comment i = im(1)
    50    
    51    in == im(1)
 00F9 6A 01                                 PUSH #1
 00FB E8 00 00                              CALL 'IM' (INTERNAL L1004 )
 00FE 83 C4 04                              ADD %ESP,#4
 0101 89 45 F4                              MOV [%EBP-12],%EAX
    52    %comment in == im(1)
    53    
    54    im(1) = 1
 0104 6A 01                                 PUSH #1
 0106 E8 00 00                              CALL 'IM' (INTERNAL L1004 )
 0109 83 C4 04                              ADD %ESP,#4
 010C C7 00 01 00 00 00                     MOV DWORD PTR [%EAX],#1
    55    %comment im(1) = 1
    56    
    57    im2 = 1
 0112 E8 00 00                              CALL 'IM2' (INTERNAL L1005 )
 0115 C7 00 01 00 00 00                     MOV DWORD PTR [%EAX],#1
    58    %comment im2 = 1
    59    
    60    rec(1)_i = 1
 011B 6A 01                                 PUSH #1
 011D FF 75 C8                              PUSH DWORD PTR [%EBP-56]
 0120 E8 09 00                              CALL '_IMPAREF' (EXTERN 9)
 0123 83 C4 08                              ADD %ESP,#8
 0126 89 C7                                 MOV %EDI,%EAX
 0128 03 7D C4                              ADD %EDI,[%EBP-60]
 012B C7 07 01 00 00 00                     MOV DWORD PTR [%EDI],#1
    61    %comment rec(1)_i = 1
    62    
    63    ir(1)
 0131 6A 01                                 PUSH #1
 0133 E8 00 00                              CALL 'IR' (INTERNAL L1006 )
 0136 83 C4 04                              ADD %ESP,#4
    64    %comment ir(1)
    65    
    66    in == ia(1)
 0139 6A 01                                 PUSH #1
 013B FF 75 E0                              PUSH DWORD PTR [%EBP-32]
 013E E8 09 00                              CALL '_IMPAREF' (EXTERN 9)
 0141 83 C4 08                              ADD %ESP,#8
 0144 89 C3                                 MOV %EBX,%EAX
 0146 03 5D DC                              ADD %EBX,[%EBP-36]
 0149 89 5D F4                              MOV [%EBP-12],%EBX
    67    %comment in == ia(1)
    68    
    69    i = ia(1)
 014C 6A 01                                 PUSH #1
 014E FF 75 E0                              PUSH DWORD PTR [%EBP-32]
 0151 E8 09 00                              CALL '_IMPAREF' (EXTERN 9)
 0154 83 C4 08                              ADD %ESP,#8
 0157 89 C6                                 MOV %ESI,%EAX
 0159 03 75 DC                              ADD %ESI,[%EBP-36]
 015C 8B 36                                 MOV %ESI,[%ESI]
 015E 89 75 F8                              MOV [%EBP-8],%ESI
    70    %comment i = ia(1)
    71    
    72    i = rm_ia(1)
 0161 E8 00 00                              CALL 'RM' (INTERNAL L1007 )
 0164 6A 01                                 PUSH #1
 0166 68 00 00 00 00                        PUSH COT+#0
 016B 89 45 C0                              MOV [%EBP-64],%EAX
 016E E8 09 00                              CALL '_IMPAREF' (EXTERN 9)
 0171 83 C4 08                              ADD %ESP,#8
 0174 8B 7D C0                              MOV %EDI,[%EBP-64]
 0177 89 C3                                 MOV %EBX,%EAX
 0179 01 FB                                 ADD %EBX,%EDI
 017B 8B 1B                                 MOV %EBX,[%EBX]
 017D 89 5D F8                              MOV [%EBP-8],%EBX
    73    %comment i = rm_ia(1)
    74    
    75    in == rm_ia(1)
 0180 E8 00 00                              CALL 'RM' (INTERNAL L1007 )
 0183 6A 01                                 PUSH #1
 0185 68 00 00 00 00                        PUSH COT+#0
 018A 89 45 BC                              MOV [%EBP-68],%EAX
 018D E8 09 00                              CALL '_IMPAREF' (EXTERN 9)
 0190 83 C4 08                              ADD %ESP,#8
 0193 8B 75 BC                              MOV %ESI,[%EBP-68]
 0196 89 C7                                 MOV %EDI,%EAX
 0198 01 F7                                 ADD %EDI,%ESI
 019A 89 7D F4                              MOV [%EBP-12],%EDI
    76    %comment in = rm_ia(1)
    77    
    78  %endofprogram
 019D C9                                    LEAVE
 019E C3                                    RET

    44 Statements compiled



 ELF object file generated from IMP source file: '/home/gtoal/src/compilers101/new-parser/imps/tests/test26.imp'
 +----------+---------------------+---------+---------+---------+------------+
 | Sections |       Symbols       | Code    | Data    | Diag    | Total size |
 +----------+----------+----------+---------+---------+---------+------------+
 |  (count) | Internal | External | (bytes) | (bytes) | (bytes) | (bytes)    |
 +----------+----------+----------+---------+---------+---------+------------+
 |       15 |       13 |        9 |     449 |     120 |     224 |        793 |
 +----------+----------+----------+---------+---------+---------+------------+


