         Edinburgh IMP77 Compiler - Version 8.4-2024.12.18

     1  ! File of externals followed by a main program.
     2  
     3  %recordformat rf ( %integer i, %real r, %integer rf)  ;! Are record format vars in a sub-scope?  Or is it just that formats are in a different name space?
     4  
     5  ! owns and externals are simpler declarations
     6  %externalinteger xi1
     7  %externalintegername xin1
     8  %externalreal xr1
     9  %externalinteger xi2,xi3
    10  %externalreal xcr1 = 3.1415
    11  %externalrealarray xra1(0:9)
    12  %externalrealarrayname xran1
    13  %externallongreal xclr1 = 3.1415
    14  %externallongrealarray xlra1(0:9)
    15  %externallongrealarrayname xlran1
    16  %externalintegernamearray xina1(0:9)
    17  %externalintegernamearrayname xinan1
    18  
    19  !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
    20  
    21  %begin
 0000 C8 00 00 01                           ENTER 0000,1
    22    %integer %array ia3, ia4(1:10), ia5(2:11,0:1,0:2)
 0004 C7 45 EC 01 00 00 00                  MOV DWORD PTR [%EBP-20],#1
 000B C7 45 F0 01 00 00 00                  MOV DWORD PTR [%EBP-16],#1
 0012 C7 45 F4 0A 00 00 00                  MOV DWORD PTR [%EBP-12],#10
 0019 C7 45 F8 83 00 00 00                  MOV DWORD PTR [%EBP-8],#131
 0020 8D 45 EC                              LEA %EAX,[%EBP-20]
 0023 50                                    PUSH %EAX
 0024 E8 0A 00                              CALL '_IMPADEF' (EXTERN 10)
 0027 83 C4 04                              ADD %ESP,#4
 002A 8D 4D EC                              LEA %ECX,[%EBP-20]
 002D 89 E3                                 MOV %EBX,%ESP
 002F 29 D3                                 SUB %EBX,%EDX
 0031 89 5D E4                              MOV [%EBP-28],%EBX
 0034 89 4D E8                              MOV [%EBP-24],%ECX
 0037 01 C3                                 ADD %EBX,%EAX
 0039 29 D3                                 SUB %EBX,%EDX
 003B 89 5D DC                              MOV [%EBP-36],%EBX
 003E 89 4D E0                              MOV [%EBP-32],%ECX
 0041 01 C3                                 ADD %EBX,%EAX
 0043 89 DC                                 MOV %ESP,%EBX
 0045 C7 45 BC 03 00 00 00                  MOV DWORD PTR [%EBP-68],#3
 004C C7 45 C0 02 00 00 00                  MOV DWORD PTR [%EBP-64],#2
 0053 C7 45 C4 0B 00 00 00                  MOV DWORD PTR [%EBP-60],#11
 005A C7 45 C8 00 00 00 00                  MOV DWORD PTR [%EBP-56],#0
 0061 C7 45 CC 01 00 00 00                  MOV DWORD PTR [%EBP-52],#1
 0068 C7 45 D0 00 00 00 00                  MOV DWORD PTR [%EBP-48],#0
 006F C7 45 D4 02 00 00 00                  MOV DWORD PTR [%EBP-44],#2
 0076 C7 45 D8 83 00 00 00                  MOV DWORD PTR [%EBP-40],#131
 007D 8D 45 BC                              LEA %EAX,[%EBP-68]
 0080 50                                    PUSH %EAX
 0081 E8 0A 00                              CALL '_IMPADEF' (EXTERN 10)
 0084 83 C4 04                              ADD %ESP,#4
 0087 8D 4D BC                              LEA %ECX,[%EBP-68]
 008A 89 E3                                 MOV %EBX,%ESP
 008C 29 D3                                 SUB %EBX,%EDX
 008E 89 5D B4                              MOV [%EBP-76],%EBX
 0091 89 4D B8                              MOV [%EBP-72],%ECX
 0094 01 C3                                 ADD %EBX,%EAX
 0096 89 DC                                 MOV %ESP,%EBX
    23    %integernamearray in3a1(2:11,0:1,0:2)
 0098 C7 45 94 03 00 00 00                  MOV DWORD PTR [%EBP-108],#3
 009F C7 45 98 02 00 00 00                  MOV DWORD PTR [%EBP-104],#2
 00A6 C7 45 9C 0B 00 00 00                  MOV DWORD PTR [%EBP-100],#11
 00AD C7 45 A0 00 00 00 00                  MOV DWORD PTR [%EBP-96],#0
 00B4 C7 45 A4 01 00 00 00                  MOV DWORD PTR [%EBP-92],#1
 00BB C7 45 A8 00 00 00 00                  MOV DWORD PTR [%EBP-88],#0
 00C2 C7 45 AC 02 00 00 00                  MOV DWORD PTR [%EBP-84],#2
 00C9 C7 45 B0 83 00 00 00                  MOV DWORD PTR [%EBP-80],#131
 00D0 8D 45 94                              LEA %EAX,[%EBP-108]
 00D3 50                                    PUSH %EAX
 00D4 E8 0A 00                              CALL '_IMPADEF' (EXTERN 10)
 00D7 83 C4 04                              ADD %ESP,#4
 00DA 8D 4D 94                              LEA %ECX,[%EBP-108]
 00DD 89 E3                                 MOV %EBX,%ESP
 00DF 29 D3                                 SUB %EBX,%EDX
 00E1 89 5D 8C                              MOV [%EBP-116],%EBX
 00E4 89 4D 90                              MOV [%EBP-112],%ECX
 00E7 01 C3                                 ADD %EBX,%EAX
 00E9 89 DC                                 MOV %ESP,%EBX
    24  
    25  xi1 = 123
 00EB C7 05 00 00 00 00 7B 00 00 00         MOV DWORD PTR [DATA+0000],#123
    26    xin1 == xi1
 00F5 B8 00 00 00 00                        MOV %EAX,DATA+#0
 00FA 89 05 04 00 00 00                     MOV [DATA+0004],%EAX
    27    xin1 = xi1
 0100 8B 35 04 00 00 00                     MOV %ESI,[DATA+0004]
 0106 A1 00 00 00 00                        MOV %EAX,[DATA+0000]
 010B 89 06                                 MOV [%ESI],%EAX
    28  
    29    xr1 = 1.23
 010D DD 05 38 00 00 00                     FLD QWORD [COT+0038]
 0113 D9 1D 08 00 00 00                     FSTP DWORD [DATA+0008]
    30    xr1 = xra1(4)
 0119 6A 04                                 PUSH #4
 011B 68 08 00 00 00                        PUSH COT+#8
 0120 E8 09 00                              CALL '_IMPAREF' (EXTERN 9)
 0123 83 C4 08                              ADD %ESP,#8
 0126 89 C7                                 MOV %EDI,%EAX
 0128 D9 87 18 00 00 00                     FLD DWORD [%EDI+DATA+24]
 012E D9 1D 08 00 00 00                     FSTP DWORD [DATA+0008]
    31    xra1(4) = xr1
 0134 6A 04                                 PUSH #4
 0136 68 08 00 00 00                        PUSH COT+#8
 013B E8 09 00                              CALL '_IMPAREF' (EXTERN 9)
 013E 83 C4 08                              ADD %ESP,#8
 0141 89 C3                                 MOV %EBX,%EAX
 0143 D9 05 08 00 00 00                     FLD DWORD [DATA+0008]
 0149 D9 9B 18 00 00 00                     FSTP DWORD [%EBX+DATA+24]
    32    xclr1 = 3.1415
 014F DD 05 00 00 00 00                     FLD QWORD [COT+0000]
 0155 DD 1D 44 00 00 00                     FSTP QWORD [DATA+0044]
    33    xlra1(4) = xclr1
 015B 6A 04                                 PUSH #4
 015D 68 18 00 00 00                        PUSH COT+#24
 0162 E8 09 00                              CALL '_IMPAREF' (EXTERN 9)
 0165 83 C4 08                              ADD %ESP,#8
 0168 89 C6                                 MOV %ESI,%EAX
 016A DD 05 44 00 00 00                     FLD QWORD [DATA+0044]
 0170 DD 9E 4C 00 00 00                     FSTP QWORD [%ESI+DATA+76]
    34    xclr1 = xlra1(4)
 0176 6A 04                                 PUSH #4
 0178 68 18 00 00 00                        PUSH COT+#24
 017D E8 09 00                              CALL '_IMPAREF' (EXTERN 9)
 0180 83 C4 08                              ADD %ESP,#8
 0183 89 C7                                 MOV %EDI,%EAX
 0185 DD 87 4C 00 00 00                     FLD QWORD [%EDI+DATA+76]
 018B DD 1D 44 00 00 00                     FSTP QWORD [DATA+0044]
    35    xina1(4) == xi1
 0191 6A 04                                 PUSH #4
 0193 68 28 00 00 00                        PUSH COT+#40
 0198 E8 09 00                              CALL '_IMPAREF' (EXTERN 9)
 019B 83 C4 08                              ADD %ESP,#8
 019E 89 C3                                 MOV %EBX,%EAX
 01A0 B8 00 00 00 00                        MOV %EAX,DATA+#0
 01A5 89 83 A4 00 00 00                     MOV [%EBX+DATA+164],%EAX
    36    xina1(4) = xi1
 01AB 6A 04                                 PUSH #4
 01AD 68 28 00 00 00                        PUSH COT+#40
 01B2 E8 09 00                              CALL '_IMPAREF' (EXTERN 9)
 01B5 83 C4 08                              ADD %ESP,#8
 01B8 89 C6                                 MOV %ESI,%EAX
 01BA 8B B6 A4 00 00 00                     MOV %ESI,[%ESI+DATA+164]
 01C0 A1 00 00 00 00                        MOV %EAX,[DATA+0000]
 01C5 89 06                                 MOV [%ESI],%EAX
    37    xinan1 == xina1
 01C7 B8 28 00 00 00                        MOV %EAX,COT+#40
 01CC 89 05 D0 00 00 00                     MOV [DATA+00D0],%EAX
 01D2 B8 A4 00 00 00                        MOV %EAX,DATA+#164
 01D7 89 05 CC 00 00 00                     MOV [DATA+00CC],%EAX
    38    xinan1(4) == xi1
 01DD 6A 04                                 PUSH #4
 01DF FF 35 D0 00 00 00                     PUSH DWORD PTR [DATA+00D0]
 01E5 E8 09 00                              CALL '_IMPAREF' (EXTERN 9)
 01E8 83 C4 08                              ADD %ESP,#8
 01EB 89 C7                                 MOV %EDI,%EAX
 01ED 03 3D CC 00 00 00                     ADD %EDI,[DATA+00CC]
 01F3 B8 00 00 00 00                        MOV %EAX,DATA+#0
 01F8 89 07                                 MOV [%EDI],%EAX
    39    xinan1(4) == xin1
 01FA 6A 04                                 PUSH #4
 01FC FF 35 D0 00 00 00                     PUSH DWORD PTR [DATA+00D0]
 0202 E8 09 00                              CALL '_IMPAREF' (EXTERN 9)
 0205 83 C4 08                              ADD %ESP,#8
 0208 89 C3                                 MOV %EBX,%EAX
 020A 03 1D CC 00 00 00                     ADD %EBX,[DATA+00CC]
 0210 A1 04 00 00 00                        MOV %EAX,[DATA+0004]
 0215 89 03                                 MOV [%EBX],%EAX
    40  
    41    
    42    ia3(4) = xi1
 0217 6A 04                                 PUSH #4
 0219 FF 75 E8                              PUSH DWORD PTR [%EBP-24]
 021C E8 09 00                              CALL '_IMPAREF' (EXTERN 9)
 021F 83 C4 08                              ADD %ESP,#8
 0222 89 C6                                 MOV %ESI,%EAX
 0224 03 75 E4                              ADD %ESI,[%EBP-28]
 0227 A1 00 00 00 00                        MOV %EAX,[DATA+0000]
 022C 89 06                                 MOV [%ESI],%EAX
    43    ia4(4) = xi1
 022E 6A 04                                 PUSH #4
 0230 FF 75 E0                              PUSH DWORD PTR [%EBP-32]
 0233 E8 09 00                              CALL '_IMPAREF' (EXTERN 9)
 0236 83 C4 08                              ADD %ESP,#8
 0239 89 C7                                 MOV %EDI,%EAX
 023B 03 7D DC                              ADD %EDI,[%EBP-36]
 023E A1 00 00 00 00                        MOV %EAX,[DATA+0000]
 0243 89 07                                 MOV [%EDI],%EAX
    44    ia5(5,0,2) = xi1
 0245 6A 05                                 PUSH #5
 0247 6A 00                                 PUSH #0
 0249 6A 02                                 PUSH #2
 024B FF 75 B8                              PUSH DWORD PTR [%EBP-72]
 024E E8 09 00                              CALL '_IMPAREF' (EXTERN 9)
 0251 83 C4 10                              ADD %ESP,#16
 0254 89 C3                                 MOV %EBX,%EAX
 0256 03 5D B4                              ADD %EBX,[%EBP-76]
 0259 A1 00 00 00 00                        MOV %EAX,[DATA+0000]
 025E 89 03                                 MOV [%EBX],%EAX
    45    xi1 = ia5(5,0,2)
 0260 6A 05                                 PUSH #5
 0262 6A 00                                 PUSH #0
 0264 6A 02                                 PUSH #2
 0266 FF 75 B8                              PUSH DWORD PTR [%EBP-72]
 0269 E8 09 00                              CALL '_IMPAREF' (EXTERN 9)
 026C 83 C4 10                              ADD %ESP,#16
 026F 89 C6                                 MOV %ESI,%EAX
 0271 03 75 B4                              ADD %ESI,[%EBP-76]
 0274 8B 36                                 MOV %ESI,[%ESI]
 0276 89 35 00 00 00 00                     MOV [DATA+0000],%ESI
    46    in3a1(6,1,1) == xi1
 027C 6A 06                                 PUSH #6
 027E 6A 01                                 PUSH #1
 0280 6A 01                                 PUSH #1
 0282 FF 75 90                              PUSH DWORD PTR [%EBP-112]
 0285 E8 09 00                              CALL '_IMPAREF' (EXTERN 9)
 0288 83 C4 10                              ADD %ESP,#16
 028B 89 C7                                 MOV %EDI,%EAX
 028D 03 7D 8C                              ADD %EDI,[%EBP-116]
 0290 B8 00 00 00 00                        MOV %EAX,DATA+#0
 0295 89 07                                 MOV [%EDI],%EAX
    47    xi1 = in3a1(6,1,1)
 0297 6A 06                                 PUSH #6
 0299 6A 01                                 PUSH #1
 029B 6A 01                                 PUSH #1
 029D FF 75 90                              PUSH DWORD PTR [%EBP-112]
 02A0 E8 09 00                              CALL '_IMPAREF' (EXTERN 9)
 02A3 83 C4 10                              ADD %ESP,#16
 02A6 89 C3                                 MOV %EBX,%EAX
 02A8 03 5D 8C                              ADD %EBX,[%EBP-116]
 02AB 8B 1B                                 MOV %EBX,[%EBX]
 02AD 8B 1B                                 MOV %EBX,[%EBX]
 02AF 89 1D 00 00 00 00                     MOV [DATA+0000],%EBX
    48  
    49  %endofprogram
 02B5 C9                                    LEAVE
 02B6 C3                                    RET

    37 Statements compiled



 ELF object file generated from IMP source file: '/home/gtoal/src/compilers101/new-parser/imps/tests/test194.imp'
 +----------+---------------------+---------+---------+---------+------------+
 | Sections |       Symbols       | Code    | Data    | Diag    | Total size |
 +----------+----------+----------+---------+---------+---------+------------+
 |  (count) | Internal | External | (bytes) | (bytes) | (bytes) | (bytes)    |
 +----------+----------+----------+---------+---------+---------+------------+
 |       13 |        6 |       21 |     729 |     272 |      32 |       1033 |
 +----------+----------+----------+---------+---------+---------+------------+


