         Edinburgh IMP77 Compiler - Version 8.4-2024.12.18

     1  %permroutinespec    write(%integer  v,p);
     2  %permroutinespec    newline
     3  
     4  %begin
 0000 C8 00 00 01                           ENTER 0000,1
     5    %routine fancy9(%integer %array (2) %name param)
 0004 EB 00                                 JMP L1001
 0006                      L1002  EQU $
 0006 C8 00 00 02                           ENTER 0000,2
     6    %end
 000A C9                                    LEAVE
 000B C3                                    RET
 000C                      L1001  EQU $
?PARAM unused
     7  
     8    %integer %array       ia0(2:3)
 000C C7 45 EC 01 00 00 00                  MOV DWORD PTR [%EBP-20],#1
 0013 C7 45 F0 02 00 00 00                  MOV DWORD PTR [%EBP-16],#2
 001A C7 45 F4 03 00 00 00                  MOV DWORD PTR [%EBP-12],#3
 0021 C7 45 F8 83 00 00 00                  MOV DWORD PTR [%EBP-8],#131
 0028 8D 45 EC                              LEA %EAX,[%EBP-20]
 002B 50                                    PUSH %EAX
 002C E8 0A 00                              CALL '_IMPADEF' (EXTERN 10)
 002F 83 C4 04                              ADD %ESP,#4
 0032 8D 4D EC                              LEA %ECX,[%EBP-20]
 0035 89 E3                                 MOV %EBX,%ESP
 0037 29 D3                                 SUB %EBX,%EDX
 0039 89 5D E4                              MOV [%EBP-28],%EBX
 003C 89 4D E8                              MOV [%EBP-24],%ECX
 003F 01 C3                                 ADD %EBX,%EAX
 0041 89 DC                                 MOV %ESP,%EBX
     9    %integer %array       ia1(2:3,1:2)
 0043 C7 45 CC 02 00 00 00                  MOV DWORD PTR [%EBP-52],#2
 004A C7 45 D0 02 00 00 00                  MOV DWORD PTR [%EBP-48],#2
 0051 C7 45 D4 03 00 00 00                  MOV DWORD PTR [%EBP-44],#3
 0058 C7 45 D8 01 00 00 00                  MOV DWORD PTR [%EBP-40],#1
 005F C7 45 DC 02 00 00 00                  MOV DWORD PTR [%EBP-36],#2
 0066 C7 45 E0 83 00 00 00                  MOV DWORD PTR [%EBP-32],#131
 006D 8D 45 CC                              LEA %EAX,[%EBP-52]
 0070 50                                    PUSH %EAX
 0071 E8 0A 00                              CALL '_IMPADEF' (EXTERN 10)
 0074 83 C4 04                              ADD %ESP,#4
 0077 8D 4D CC                              LEA %ECX,[%EBP-52]
 007A 89 E3                                 MOV %EBX,%ESP
 007C 29 D3                                 SUB %EBX,%EDX
 007E 89 5D C4                              MOV [%EBP-60],%EBX
 0081 89 4D C8                              MOV [%EBP-56],%ECX
 0084 01 C3                                 ADD %EBX,%EAX
 0086 89 DC                                 MOV %ESP,%EBX
    10    %integer %array       ia2(1:2,1:3)
 0088 C7 45 AC 02 00 00 00                  MOV DWORD PTR [%EBP-84],#2
 008F C7 45 B0 01 00 00 00                  MOV DWORD PTR [%EBP-80],#1
 0096 C7 45 B4 02 00 00 00                  MOV DWORD PTR [%EBP-76],#2
 009D C7 45 B8 01 00 00 00                  MOV DWORD PTR [%EBP-72],#1
 00A4 C7 45 BC 03 00 00 00                  MOV DWORD PTR [%EBP-68],#3
 00AB C7 45 C0 83 00 00 00                  MOV DWORD PTR [%EBP-64],#131
 00B2 8D 45 AC                              LEA %EAX,[%EBP-84]
 00B5 50                                    PUSH %EAX
 00B6 E8 0A 00                              CALL '_IMPADEF' (EXTERN 10)
 00B9 83 C4 04                              ADD %ESP,#4
 00BC 8D 4D AC                              LEA %ECX,[%EBP-84]
 00BF 89 E3                                 MOV %EBX,%ESP
 00C1 29 D3                                 SUB %EBX,%EDX
 00C3 89 5D A4                              MOV [%EBP-92],%EBX
 00C6 89 4D A8                              MOV [%EBP-88],%ECX
 00C9 01 C3                                 ADD %EBX,%EAX
 00CB 89 DC                                 MOV %ESP,%EBX
    11  
    12    %integer %array     %name ian0
    13    %integer %array (2) %name ian1
    14  
    15    ia1(2,1) = 221; ia1(3,1) = 331
 00CD 6A 02                                 PUSH #2
 00CF 6A 01                                 PUSH #1
 00D1 FF 75 C8                              PUSH DWORD PTR [%EBP-56]
 00D4 E8 09 00                              CALL '_IMPAREF' (EXTERN 9)
 00D7 83 C4 0C                              ADD %ESP,#12
 00DA 89 C6                                 MOV %ESI,%EAX
 00DC 03 75 C4                              ADD %ESI,[%EBP-60]
 00DF C7 06 DD 00 00 00                     MOV DWORD PTR [%ESI],#221
 00E5 6A 03                                 PUSH #3
 00E7 6A 01                                 PUSH #1
 00E9 FF 75 C8                              PUSH DWORD PTR [%EBP-56]
 00EC E8 09 00                              CALL '_IMPAREF' (EXTERN 9)
 00EF 83 C4 0C                              ADD %ESP,#12
 00F2 89 C7                                 MOV %EDI,%EAX
 00F4 03 7D C4                              ADD %EDI,[%EBP-60]
 00F7 C7 07 4B 01 00 00                     MOV DWORD PTR [%EDI],#331
    16    ia1(2,2) = 10;  ia1(3,2) = 20
 00FD 6A 02                                 PUSH #2
 00FF 6A 02                                 PUSH #2
 0101 FF 75 C8                              PUSH DWORD PTR [%EBP-56]
 0104 E8 09 00                              CALL '_IMPAREF' (EXTERN 9)
 0107 83 C4 0C                              ADD %ESP,#12
 010A 89 C3                                 MOV %EBX,%EAX
 010C 03 5D C4                              ADD %EBX,[%EBP-60]
 010F C7 03 0A 00 00 00                     MOV DWORD PTR [%EBX],#10
 0115 6A 03                                 PUSH #3
 0117 6A 02                                 PUSH #2
 0119 FF 75 C8                              PUSH DWORD PTR [%EBP-56]
 011C E8 09 00                              CALL '_IMPAREF' (EXTERN 9)
 011F 83 C4 0C                              ADD %ESP,#12
 0122 89 C6                                 MOV %ESI,%EAX
 0124 03 75 C4                              ADD %ESI,[%EBP-60]
 0127 C7 06 14 00 00 00                     MOV DWORD PTR [%ESI],#20
    17  
    18    ia2(1,1) = 8221;  ia2(2,1) = 9331
 012D 6A 01                                 PUSH #1
 012F 6A 01                                 PUSH #1
 0131 FF 75 A8                              PUSH DWORD PTR [%EBP-88]
 0134 E8 09 00                              CALL '_IMPAREF' (EXTERN 9)
 0137 83 C4 0C                              ADD %ESP,#12
 013A 89 C7                                 MOV %EDI,%EAX
 013C 03 7D A4                              ADD %EDI,[%EBP-92]
 013F C7 07 1D 20 00 00                     MOV DWORD PTR [%EDI],#8221
 0145 6A 02                                 PUSH #2
 0147 6A 01                                 PUSH #1
 0149 FF 75 A8                              PUSH DWORD PTR [%EBP-88]
 014C E8 09 00                              CALL '_IMPAREF' (EXTERN 9)
 014F 83 C4 0C                              ADD %ESP,#12
 0152 89 C3                                 MOV %EBX,%EAX
 0154 03 5D A4                              ADD %EBX,[%EBP-92]
 0157 C7 03 73 24 00 00                     MOV DWORD PTR [%EBX],#9331
    19    ia2(1,2) = 8010;  ia2(2,2) = 9020
 015D 6A 01                                 PUSH #1
 015F 6A 02                                 PUSH #2
 0161 FF 75 A8                              PUSH DWORD PTR [%EBP-88]
 0164 E8 09 00                              CALL '_IMPAREF' (EXTERN 9)
 0167 83 C4 0C                              ADD %ESP,#12
 016A 89 C6                                 MOV %ESI,%EAX
 016C 03 75 A4                              ADD %ESI,[%EBP-92]
 016F C7 06 4A 1F 00 00                     MOV DWORD PTR [%ESI],#8010
 0175 6A 02                                 PUSH #2
 0177 6A 02                                 PUSH #2
 0179 FF 75 A8                              PUSH DWORD PTR [%EBP-88]
 017C E8 09 00                              CALL '_IMPAREF' (EXTERN 9)
 017F 83 C4 0C                              ADD %ESP,#12
 0182 89 C7                                 MOV %EDI,%EAX
 0184 03 7D A4                              ADD %EDI,[%EBP-92]
 0187 C7 07 3C 23 00 00                     MOV DWORD PTR [%EDI],#9020
    20    ia2(1,3) = 8333;  ia2(2,3) = 9333
 018D 6A 01                                 PUSH #1
 018F 6A 03                                 PUSH #3
 0191 FF 75 A8                              PUSH DWORD PTR [%EBP-88]
 0194 E8 09 00                              CALL '_IMPAREF' (EXTERN 9)
 0197 83 C4 0C                              ADD %ESP,#12
 019A 89 C3                                 MOV %EBX,%EAX
 019C 03 5D A4                              ADD %EBX,[%EBP-92]
 019F C7 03 8D 20 00 00                     MOV DWORD PTR [%EBX],#8333
 01A5 6A 02                                 PUSH #2
 01A7 6A 03                                 PUSH #3
 01A9 FF 75 A8                              PUSH DWORD PTR [%EBP-88]
 01AC E8 09 00                              CALL '_IMPAREF' (EXTERN 9)
 01AF 83 C4 0C                              ADD %ESP,#12
 01B2 89 C6                                 MOV %ESI,%EAX
 01B4 03 75 A4                              ADD %ESI,[%EBP-92]
 01B7 C7 06 75 24 00 00                     MOV DWORD PTR [%ESI],#9333
    21  
    22    ian1 == ia1
 01BD 8B 45 C8                              MOV %EAX,[%EBP-56]
 01C0 89 45 98                              MOV [%EBP-104],%EAX
 01C3 8B 45 C4                              MOV %EAX,[%EBP-60]
 01C6 89 45 94                              MOV [%EBP-108],%EAX
    23    write(ian1(2,1),0)
 01C9 6A 02                                 PUSH #2
 01CB 6A 01                                 PUSH #1
 01CD FF 75 98                              PUSH DWORD PTR [%EBP-104]
 01D0 E8 09 00                              CALL '_IMPAREF' (EXTERN 9)
 01D3 83 C4 0C                              ADD %ESP,#12
 01D6 89 C7                                 MOV %EDI,%EAX
 01D8 03 7D 94                              ADD %EDI,[%EBP-108]
 01DB FF 37                                 PUSH DWORD PTR [%EDI]
 01DD 6A 00                                 PUSH #0
 01DF E8 6E 00                              CALL 'WRITE' (EXTERN 110)
 01E2 83 C4 08                              ADD %ESP,#8
    24    newline
 01E5 E8 6F 00                              CALL 'NEWLINE' (EXTERN 111)
    25  
    26    fancy9(ian1)
 01E8 FF 75 98                              PUSH DWORD PTR [%EBP-104]
 01EB FF 75 94                              PUSH DWORD PTR [%EBP-108]
 01EE E8 00 00                              CALL 'FANCY9' (INTERNAL L1002 )
 01F1 83 C4 08                              ADD %ESP,#8
    27  
    28    ian1 == ia2
 01F4 8B 45 A8                              MOV %EAX,[%EBP-88]
 01F7 89 45 98                              MOV [%EBP-104],%EAX
 01FA 8B 45 A4                              MOV %EAX,[%EBP-92]
 01FD 89 45 94                              MOV [%EBP-108],%EAX
    29    write(ian1(2,1),0)
 0200 6A 02                                 PUSH #2
 0202 6A 01                                 PUSH #1
 0204 FF 75 98                              PUSH DWORD PTR [%EBP-104]
 0207 E8 09 00                              CALL '_IMPAREF' (EXTERN 9)
 020A 83 C4 0C                              ADD %ESP,#12
 020D 89 C3                                 MOV %EBX,%EAX
 020F 03 5D 94                              ADD %EBX,[%EBP-108]
 0212 FF 33                                 PUSH DWORD PTR [%EBX]
 0214 6A 00                                 PUSH #0
 0216 E8 6E 00                              CALL 'WRITE' (EXTERN 110)
 0219 83 C4 08                              ADD %ESP,#8
    30    newline
 021C E8 6F 00                              CALL 'NEWLINE' (EXTERN 111)
    31  
    32    ian0 == ia0
 021F 8B 45 E8                              MOV %EAX,[%EBP-24]
 0222 89 45 A0                              MOV [%EBP-96],%EAX
 0225 8B 45 E4                              MOV %EAX,[%EBP-28]
 0228 89 45 9C                              MOV [%EBP-100],%EAX
    33  
    34    !fancy9(ia0) not allowed
    35  
    36    fancy9(ia1)
 022B FF 75 C8                              PUSH DWORD PTR [%EBP-56]
 022E FF 75 C4                              PUSH DWORD PTR [%EBP-60]
 0231 E8 00 00                              CALL 'FANCY9' (INTERNAL L1002 )
 0234 83 C4 08                              ADD %ESP,#8
    37    fancy9(ian1)
 0237 FF 75 98                              PUSH DWORD PTR [%EBP-104]
 023A FF 75 94                              PUSH DWORD PTR [%EBP-108]
 023D E8 00 00                              CALL 'FANCY9' (INTERNAL L1002 )
 0240 83 C4 08                              ADD %ESP,#8
    38    
    39  %endofprogram
 0243 C9                                    LEAVE
 0244 C3                                    RET

    31 Statements compiled



 ELF object file generated from IMP source file: '/home/gtoal/src/compilers101/new-parser/imps/tests/test22.imp'
 +----------+---------------------+---------+---------+---------+------------+
 | Sections |       Symbols       | Code    | Data    | Diag    | Total size |
 +----------+----------+----------+---------+---------+---------+------------+
 |  (count) | Internal | External | (bytes) | (bytes) | (bytes) | (bytes)    |
 +----------+----------+----------+---------+---------+---------+------------+
 |       11 |        5 |       10 |     625 |       0 |      64 |        689 |
 +----------+----------+----------+---------+---------+---------+------------+


