         Edinburgh IMP77 Compiler - Version 8.4-2024.12.18

     1  %begin
 0000 C8 00 00 01                           ENTER 0000,1
     2    %integer I
     3    %routine R
 0004 EB 00                                 JMP L1001
 0006                      L1002  EQU $
 0006 C8 00 00 02                           ENTER 0000,2
     4    %end
 000A C9                                    LEAVE
 000B C3                                    RET
 000C                      L1001  EQU $
     5    %routine RP(%integer I)
     6    %end
 000C                      L1003  EQU $
 000C C8 00 00 02                           ENTER 0000,2
 0010 C9                                    LEAVE
 0011 C3                                    RET
 0012                      L1001  EQU $
?I unused
     7    %integerarray IA(1:2)
     8    %integermap IM
 0012 C7 45 E8 01 00 00 00                  MOV DWORD PTR [%EBP-24],#1
 0019 C7 45 EC 01 00 00 00                  MOV DWORD PTR [%EBP-20],#1
 0020 C7 45 F0 02 00 00 00                  MOV DWORD PTR [%EBP-16],#2
 0027 C7 45 F4 83 00 00 00                  MOV DWORD PTR [%EBP-12],#131
 002E 8D 45 E8                              LEA %EAX,[%EBP-24]
 0031 50                                    PUSH %EAX
 0032 E8 0A 00                              CALL '_IMPADEF' (EXTERN 10)
 0035 83 C4 04                              ADD %ESP,#4
 0038 8D 4D E8                              LEA %ECX,[%EBP-24]
 003B 89 E3                                 MOV %EBX,%ESP
 003D 29 D3                                 SUB %EBX,%EDX
 003F 89 5D E0                              MOV [%EBP-32],%EBX
 0042 89 4D E4                              MOV [%EBP-28],%ECX
 0045 01 C3                                 ADD %EBX,%EAX
 0047 89 DC                                 MOV %ESP,%EBX
 0049 EB 00                                 JMP L1004
 004B                      L1005  EQU $
 004B C8 00 00 02                           ENTER 0000,2
     9      %result == I
 004F 8B 75 FC                              MOV %ESI,[%EBP-4]
 0052 8D 46 F8                              LEA %EAX,[%ESI-8]
 0055 C9                                    LEAVE
 0056 C3                                    RET
    10    %end
 0057                      L1004  EQU $
    11    %integermap IMP(%integer N)
    12      %result == IA(N)
 0057                      L1006  EQU $
 0057 C8 00 00 02                           ENTER 0000,2
 005B FF 75 08                              PUSH DWORD PTR [%EBP+8]
 005E 8B 7D FC                              MOV %EDI,[%EBP-4]
 0061 FF 77 E4                              PUSH DWORD PTR [%EDI-28]
 0064 89 7D F4                              MOV [%EBP-12],%EDI
 0067 E8 09 00                              CALL '_IMPAREF' (EXTERN 9)
 006A 83 C4 08                              ADD %ESP,#8
 006D 89 C3                                 MOV %EBX,%EAX
 006F 8B 75 F4                              MOV %ESI,[%EBP-12]
 0072 03 5E E0                              ADD %EBX,[%ESI-32]
 0075 89 D8                                 MOV %EAX,%EBX
 0077 C9                                    LEAVE
 0078 C3                                    RET
    13    %end
 0079                      L1004  EQU $
    14    %integername IN
    15    
    16    R
 0079 E8 00 00                              CALL 'R' (INTERNAL L1002 )
    17    %comment R
    18    RP(42)
 007C 6A 2A                                 PUSH #42
 007E E8 00 00                              CALL 'RP' (INTERNAL L1003 )
 0081 83 C4 04                              ADD %ESP,#4
    19    %comment RP(42)
    20    IA(53) = I
 0084 6A 35                                 PUSH #53
 0086 FF 75 E4                              PUSH DWORD PTR [%EBP-28]
 0089 E8 09 00                              CALL '_IMPAREF' (EXTERN 9)
 008C 83 C4 08                              ADD %ESP,#8
 008F 89 C7                                 MOV %EDI,%EAX
 0091 03 7D E0                              ADD %EDI,[%EBP-32]
 0094 8B 45 F8                              MOV %EAX,[%EBP-8]
 0097 89 07                                 MOV [%EDI],%EAX
    21    %comment IA(53) = I
    22    I = IA(64)
 0099 6A 40                                 PUSH #64
 009B FF 75 E4                              PUSH DWORD PTR [%EBP-28]
 009E E8 09 00                              CALL '_IMPAREF' (EXTERN 9)
 00A1 83 C4 08                              ADD %ESP,#8
 00A4 89 C3                                 MOV %EBX,%EAX
 00A6 03 5D E0                              ADD %EBX,[%EBP-32]
 00A9 8B 1B                                 MOV %EBX,[%EBX]
 00AB 89 5D F8                              MOV [%EBP-8],%EBX
    23    %comment I = IA(64)
    24    IN == IM
 00AE E8 00 00                              CALL 'IM' (INTERNAL L1005 )
 00B1 89 45 DC                              MOV [%EBP-36],%EAX
    25    %comment IN == IM
    26    IN == IMP(1)
 00B4 6A 01                                 PUSH #1
 00B6 E8 00 00                              CALL 'IMP' (INTERNAL L1006 )
 00B9 83 C4 04                              ADD %ESP,#4
 00BC 89 45 DC                              MOV [%EBP-36],%EAX
    27    %comment IN == IMP(1)
    28    IN == I
 00BF 8D 45 F8                              LEA %EAX,[%EBP-8]
 00C2 89 45 DC                              MOV [%EBP-36],%EAX
    29    %comment IN == I
    30    IN = I
 00C5 8B 75 DC                              MOV %ESI,[%EBP-36]
 00C8 8B 45 F8                              MOV %EAX,[%EBP-8]
 00CB 89 06                                 MOV [%ESI],%EAX
    31    %comment IN = I
    32    IM = I
 00CD E8 00 00                              CALL 'IM' (INTERNAL L1005 )
 00D0 8B 4D F8                              MOV %ECX,[%EBP-8]
 00D3 89 08                                 MOV [%EAX],%ECX
    33    %comment IM = I
    34    IMP(2) = I
 00D5 6A 02                                 PUSH #2
 00D7 E8 00 00                              CALL 'IMP' (INTERNAL L1006 )
 00DA 83 C4 04                              ADD %ESP,#4
 00DD 8B 4D F8                              MOV %ECX,[%EBP-8]
 00E0 89 08                                 MOV [%EAX],%ECX
    35    %comment IMP(2) = I
    36  
    37  %endofprogram
 00E2 C9                                    LEAVE
 00E3 C3                                    RET

    25 Statements compiled



 ELF object file generated from IMP source file: '/home/gtoal/src/compilers101/new-parser/imps/tests/test37.imp'
 +----------+---------------------+---------+---------+---------+------------+
 | Sections |       Symbols       | Code    | Data    | Diag    | Total size |
 +----------+----------+----------+---------+---------+---------+------------+
 |  (count) | Internal | External | (bytes) | (bytes) | (bytes) | (bytes)    |
 +----------+----------+----------+---------+---------+---------+------------+
 |       11 |        8 |        8 |     248 |       0 |     160 |        408 |
 +----------+----------+----------+---------+---------+---------+------------+


