         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    %externalinteger ie
     5    %integerarray    ia(0:9)
 0004 C7 45 E8 01 00 00 00                  MOV DWORD PTR [%EBP-24],#1
 000B C7 45 EC 00 00 00 00                  MOV DWORD PTR [%EBP-20],#0
 0012 C7 45 F0 09 00 00 00                  MOV DWORD PTR [%EBP-16],#9
 0019 C7 45 F4 83 00 00 00                  MOV DWORD PTR [%EBP-12],#131
 0020 8D 45 E8                              LEA %EAX,[%EBP-24]
 0023 50                                    PUSH %EAX
 0024 E8 0A 00                              CALL '_IMPADEF' (EXTERN 10)
 0027 83 C4 04                              ADD %ESP,#4
 002A 8D 4D E8                              LEA %ECX,[%EBP-24]
 002D 89 E3                                 MOV %EBX,%ESP
 002F 29 D3                                 SUB %EBX,%EDX
 0031 89 5D E0                              MOV [%EBP-32],%EBX
 0034 89 4D E4                              MOV [%EBP-28],%ECX
 0037 01 C3                                 ADD %EBX,%EAX
 0039 89 DC                                 MOV %ESP,%EBX
     6    %integerfn       ifn
 003B EB 00                                 JMP L1001
 003D                      L1002  EQU $
 003D C8 00 00 02                           ENTER 0000,2
     7      %result = 1
 0041 B8 01 00 00 00                        MOV %EAX,#1
 0046 C9                                    LEAVE
 0047 C3                                    RET
     8    %end
 0048                      L1001  EQU $
     9    %integermap      im
    10      %result ==  io
 0048                      L1003  EQU $
 0048 C8 00 00 02                           ENTER 0000,2
 004C B8 00 00 00 00                        MOV %EAX,DATA+#0
 0051 C9                                    LEAVE
 0052 C3                                    RET
    11    %end
 0053                      L1001  EQU $
    12    %routine         ir
    13    %end
 0053                      L1004  EQU $
 0053 C8 00 00 02                           ENTER 0000,2
 0057 C9                                    LEAVE
 0058 C3                                    RET
 0059                      L1001  EQU $
    14    %recordformat    rf(%integer i)
    15    %record(rf)%array  rec(0:9)
 0059 C7 45 D0 01 00 00 00                  MOV DWORD PTR [%EBP-48],#1
 0060 C7 45 D4 00 00 00 00                  MOV DWORD PTR [%EBP-44],#0
 0067 C7 45 D8 09 00 00 00                  MOV DWORD PTR [%EBP-40],#9
 006E C7 45 DC 89 00 00 00                  MOV DWORD PTR [%EBP-36],#137
 0075 8D 45 D0                              LEA %EAX,[%EBP-48]
 0078 50                                    PUSH %EAX
 0079 E8 0A 00                              CALL '_IMPADEF' (EXTERN 10)
 007C 83 C4 04                              ADD %ESP,#4
 007F 8D 4D D0                              LEA %ECX,[%EBP-48]
 0082 89 E3                                 MOV %EBX,%ESP
 0084 29 D3                                 SUB %EBX,%EDX
 0086 89 5D C8                              MOV [%EBP-56],%EBX
 0089 89 4D CC                              MOV [%EBP-52],%ECX
 008C 01 C3                                 ADD %EBX,%EAX
 008E 89 DC                                 MOV %ESP,%EBX
    16    %switch          sw(0:9)
    17  
    18  
    19    io = 1
 0090 C7 05 00 00 00 00 01 00 00 00         MOV DWORD PTR [DATA+0000],#1
    20    %comment io = 1
    21    ie = 1
 009A C7 05 04 00 00 00 01 00 00 00         MOV DWORD PTR [DATA+0004],#1
    22    %comment ie = 1
    23    ia(1) = 1
 00A4 6A 01                                 PUSH #1
 00A6 FF 75 E4                              PUSH DWORD PTR [%EBP-28]
 00A9 E8 09 00                              CALL '_IMPAREF' (EXTERN 9)
 00AC 83 C4 08                              ADD %ESP,#8
 00AF 89 C6                                 MOV %ESI,%EAX
 00B1 03 75 E0                              ADD %ESI,[%EBP-32]
 00B4 C7 06 01 00 00 00                     MOV DWORD PTR [%ESI],#1
    24    %comment ia(1) = 1
    25    i = ifn
 00BA E8 00 00                              CALL 'IFN' (INTERNAL L1002 )
 00BD 89 45 F8                              MOV [%EBP-8],%EAX
    26    %comment i = ifn(1)
    27    i = im
 00C0 E8 00 00                              CALL 'IM' (INTERNAL L1003 )
 00C3 8B 00                                 MOV %EAX,[%EAX]
 00C5 89 45 F8                              MOV [%EBP-8],%EAX
    28    %comment i = im(1)
    29    rec(1)_i = 1
 00C8 6A 01                                 PUSH #1
 00CA FF 75 CC                              PUSH DWORD PTR [%EBP-52]
 00CD E8 09 00                              CALL '_IMPAREF' (EXTERN 9)
 00D0 83 C4 08                              ADD %ESP,#8
 00D3 89 C7                                 MOV %EDI,%EAX
 00D5 03 7D C8                              ADD %EDI,[%EBP-56]
 00D8 C7 07 01 00 00 00                     MOV DWORD PTR [%EDI],#1
    30    %comment rec(1)_i = 1
    31    sw(1):
 00DE                      L1005  EQU $
    32    %comment sw(1):
    33    ir
 00DE E8 00 00                              CALL 'IR' (INTERNAL L1004 )
    34  
    35  %endofprogram
 00E1 C9                                    LEAVE
 00E2 C3                                    RET

    24 Statements compiled



 ELF object file generated from IMP source file: '/home/gtoal/src/compilers101/new-parser/imps/tests/test28.imp'
 +----------+---------------------+---------+---------+---------+------------+
 | Sections |       Symbols       | Code    | Data    | Diag    | Total size |
 +----------+----------+----------+---------+---------+---------+------------+
 |  (count) | Internal | External | (bytes) | (bytes) | (bytes) | (bytes)    |
 +----------+----------+----------+---------+---------+---------+------------+
 |       15 |       10 |        9 |     241 |      64 |     128 |        433 |
 +----------+----------+----------+---------+---------+---------+------------+


