         Edinburgh IMP77 Compiler - Version 8.4-2024.12.18

     1  %begin
 0000 C8 00 00 01                           ENTER 0000,1
     2    ! It would appear that Imp and C do not store their arrays in the same x-major order.
     3    %integerarray d2(0:1, 0:2)
 0004 C7 45 E4 02 00 00 00                  MOV DWORD PTR [%EBP-28],#2
 000B C7 45 E8 00 00 00 00                  MOV DWORD PTR [%EBP-24],#0
 0012 C7 45 EC 01 00 00 00                  MOV DWORD PTR [%EBP-20],#1
 0019 C7 45 F0 00 00 00 00                  MOV DWORD PTR [%EBP-16],#0
 0020 C7 45 F4 02 00 00 00                  MOV DWORD PTR [%EBP-12],#2
 0027 C7 45 F8 83 00 00 00                  MOV DWORD PTR [%EBP-8],#131
 002E 8D 45 E4                              LEA %EAX,[%EBP-28]
 0031 50                                    PUSH %EAX
 0032 E8 0A 00                              CALL '_IMPADEF' (EXTERN 10)
 0035 83 C4 04                              ADD %ESP,#4
 0038 8D 4D E4                              LEA %ECX,[%EBP-28]
 003B 89 E3                                 MOV %EBX,%ESP
 003D 29 D3                                 SUB %EBX,%EDX
 003F 89 5D DC                              MOV [%EBP-36],%EBX
 0042 89 4D E0                              MOV [%EBP-32],%ECX
 0045 01 C3                                 ADD %EBX,%EAX
 0047 89 DC                                 MOV %ESP,%EBX
     4    %ownintegerarray d1(0:5) = 0,1,2,3,4,5
     5    %integername d, e
     6    %integer i,j
     7    d == d2(0,0);            e == d1(0);              d = e;
 0049 6A 00                                 PUSH #0
 004B 6A 00                                 PUSH #0
 004D FF 75 E0                              PUSH DWORD PTR [%EBP-32]
 0050 E8 09 00                              CALL '_IMPAREF' (EXTERN 9)
 0053 83 C4 0C                              ADD %ESP,#12
 0056 89 C6                                 MOV %ESI,%EAX
 0058 03 75 DC                              ADD %ESI,[%EBP-36]
 005B 89 75 D8                              MOV [%EBP-40],%ESI
 005E 6A 00                                 PUSH #0
 0060 68 00 00 00 00                        PUSH COT+#0
 0065 E8 09 00                              CALL '_IMPAREF' (EXTERN 9)
 0068 83 C4 08                              ADD %ESP,#8
 006B 89 C7                                 MOV %EDI,%EAX
 006D 8D BF 00 00 00 00                     LEA %EDI,[%EDI+DATA]
 0073 89 7D D4                              MOV [%EBP-44],%EDI
 0076 8B 5D D8                              MOV %EBX,[%EBP-40]
 0079 8B 75 D4                              MOV %ESI,[%EBP-44]
 007C 8B 06                                 MOV %EAX,[%ESI]
 007E 89 03                                 MOV [%EBX],%EAX
     8    d == INTEGER(addr(d)+4); e == INTEGER(ADDR(e)+4); d = e
 0080 8B 45 D8                              MOV %EAX,[%EBP-40]
 0083 05 04 00 00 00                        ADD %EAX,#4
 0088 89 45 D8                              MOV [%EBP-40],%EAX
 008B 8B 45 D4                              MOV %EAX,[%EBP-44]
 008E 05 04 00 00 00                        ADD %EAX,#4
 0093 89 45 D4                              MOV [%EBP-44],%EAX
 0096 8B 7D D8                              MOV %EDI,[%EBP-40]
 0099 8B 5D D4                              MOV %EBX,[%EBP-44]
 009C 8B 03                                 MOV %EAX,[%EBX]
 009E 89 07                                 MOV [%EDI],%EAX
     9    d == INTEGER(addr(d)+4); e == INTEGER(ADDR(e)+4); d = e
 00A0 8B 45 D8                              MOV %EAX,[%EBP-40]
 00A3 05 04 00 00 00                        ADD %EAX,#4
 00A8 89 45 D8                              MOV [%EBP-40],%EAX
 00AB 8B 45 D4                              MOV %EAX,[%EBP-44]
 00AE 05 04 00 00 00                        ADD %EAX,#4
 00B3 89 45 D4                              MOV [%EBP-44],%EAX
 00B6 8B 75 D8                              MOV %ESI,[%EBP-40]
 00B9 8B 7D D4                              MOV %EDI,[%EBP-44]
 00BC 8B 07                                 MOV %EAX,[%EDI]
 00BE 89 06                                 MOV [%ESI],%EAX
    10    d == INTEGER(addr(d)+4); e == INTEGER(ADDR(e)+4); d = e
 00C0 8B 45 D8                              MOV %EAX,[%EBP-40]
 00C3 05 04 00 00 00                        ADD %EAX,#4
 00C8 89 45 D8                              MOV [%EBP-40],%EAX
 00CB 8B 45 D4                              MOV %EAX,[%EBP-44]
 00CE 05 04 00 00 00                        ADD %EAX,#4
 00D3 89 45 D4                              MOV [%EBP-44],%EAX
 00D6 8B 5D D8                              MOV %EBX,[%EBP-40]
 00D9 8B 75 D4                              MOV %ESI,[%EBP-44]
 00DC 8B 06                                 MOV %EAX,[%ESI]
 00DE 89 03                                 MOV [%EBX],%EAX
    11    d == INTEGER(addr(d)+4); e == INTEGER(ADDR(e)+4); d = e
 00E0 8B 45 D8                              MOV %EAX,[%EBP-40]
 00E3 05 04 00 00 00                        ADD %EAX,#4
 00E8 89 45 D8                              MOV [%EBP-40],%EAX
 00EB 8B 45 D4                              MOV %EAX,[%EBP-44]
 00EE 05 04 00 00 00                        ADD %EAX,#4
 00F3 89 45 D4                              MOV [%EBP-44],%EAX
 00F6 8B 7D D8                              MOV %EDI,[%EBP-40]
 00F9 8B 5D D4                              MOV %EBX,[%EBP-44]
 00FC 8B 03                                 MOV %EAX,[%EBX]
 00FE 89 07                                 MOV [%EDI],%EAX
    12    d == INTEGER(addr(d)+4); e == INTEGER(ADDR(e)+4); d = e
 0100 8B 45 D8                              MOV %EAX,[%EBP-40]
 0103 05 04 00 00 00                        ADD %EAX,#4
 0108 89 45 D8                              MOV [%EBP-40],%EAX
 010B 8B 45 D4                              MOV %EAX,[%EBP-44]
 010E 05 04 00 00 00                        ADD %EAX,#4
 0113 89 45 D4                              MOV [%EBP-44],%EAX
 0116 8B 75 D8                              MOV %ESI,[%EBP-40]
 0119 8B 7D D4                              MOV %EDI,[%EBP-44]
 011C 8B 07                                 MOV %EAX,[%EDI]
 011E 89 06                                 MOV [%ESI],%EAX
    13    %for i = 0, 1, 1 %cycle
 0120 C7 45 D0 FF FF FF FF                  MOV DWORD PTR [%EBP-48],#-1
 0127                      L1001  EQU $
 0127 8B 45 D0                              MOV %EAX,[%EBP-48]
 012A 3D 01 00 00 00                        CMP %EAX,#1
 012F 74 00                                 JE L1002
 0131 40                                    INC %EAX
 0132 89 45 D0                              MOV [%EBP-48],%EAX
    14      %for j = 0, 1, 2 %cycle
 0135 C7 45 CC FF FF FF FF                  MOV DWORD PTR [%EBP-52],#-1
 013C                      L1003  EQU $
 013C 8B 45 CC                              MOV %EAX,[%EBP-52]
 013F 3D 02 00 00 00                        CMP %EAX,#2
 0144 74 00                                 JE L1004
 0146 40                                    INC %EAX
 0147 89 45 CC                              MOV [%EBP-52],%EAX
    15        printstring("d2(");write(i,0);printstring(", ");write(j,0);printstring(") = "); write(d2(i,j),0);printstring(",  ");
 014A 81 EC 00 01 00 00                     SUB %ESP,#256
 0150 89 E0                                 MOV %EAX,%ESP
 0152 50                                    PUSH %EAX
 0153 B8 10 00 00 00                        MOV %EAX,COT+#16
 0158 50                                    PUSH %EAX
 0159 68 FF 00 00 00                        PUSH #255
 015E E8 03 00                              CALL '_IMPSTRCPY' (EXTERN 3)
 0161 83 C4 0C                              ADD %ESP,#12
 0164 E8 3B 00                              CALL 'PRINTSTRING' (EXTERN 59)
 0167 81 C4 00 01 00 00                     ADD %ESP,#256
 016D FF 75 D0                              PUSH DWORD PTR [%EBP-48]
 0170 6A 00                                 PUSH #0
 0172 E8 40 00                              CALL 'WRITE' (EXTERN 64)
 0175 83 C4 08                              ADD %ESP,#8
 0178 81 EC 00 01 00 00                     SUB %ESP,#256
 017E 89 E0                                 MOV %EAX,%ESP
 0180 50                                    PUSH %EAX
 0181 B8 14 00 00 00                        MOV %EAX,COT+#20
 0186 50                                    PUSH %EAX
 0187 68 FF 00 00 00                        PUSH #255
 018C E8 03 00                              CALL '_IMPSTRCPY' (EXTERN 3)
 018F 83 C4 0C                              ADD %ESP,#12
 0192 E8 3B 00                              CALL 'PRINTSTRING' (EXTERN 59)
 0195 81 C4 00 01 00 00                     ADD %ESP,#256
 019B FF 75 CC                              PUSH DWORD PTR [%EBP-52]
 019E 6A 00                                 PUSH #0
 01A0 E8 40 00                              CALL 'WRITE' (EXTERN 64)
 01A3 83 C4 08                              ADD %ESP,#8
 01A6 81 EC 00 01 00 00                     SUB %ESP,#256
 01AC 89 E0                                 MOV %EAX,%ESP
 01AE 50                                    PUSH %EAX
 01AF B8 17 00 00 00                        MOV %EAX,COT+#23
 01B4 50                                    PUSH %EAX
 01B5 68 FF 00 00 00                        PUSH #255
 01BA E8 03 00                              CALL '_IMPSTRCPY' (EXTERN 3)
 01BD 83 C4 0C                              ADD %ESP,#12
 01C0 E8 3B 00                              CALL 'PRINTSTRING' (EXTERN 59)
 01C3 81 C4 00 01 00 00                     ADD %ESP,#256
 01C9 FF 75 D0                              PUSH DWORD PTR [%EBP-48]
 01CC FF 75 CC                              PUSH DWORD PTR [%EBP-52]
 01CF FF 75 E0                              PUSH DWORD PTR [%EBP-32]
 01D2 E8 09 00                              CALL '_IMPAREF' (EXTERN 9)
 01D5 83 C4 0C                              ADD %ESP,#12
 01D8 89 C3                                 MOV %EBX,%EAX
 01DA 03 5D DC                              ADD %EBX,[%EBP-36]
 01DD FF 33                                 PUSH DWORD PTR [%EBX]
 01DF 6A 00                                 PUSH #0
 01E1 E8 40 00                              CALL 'WRITE' (EXTERN 64)
 01E4 83 C4 08                              ADD %ESP,#8
 01E7 81 EC 00 01 00 00                     SUB %ESP,#256
 01ED 89 E0                                 MOV %EAX,%ESP
 01EF 50                                    PUSH %EAX
 01F0 B8 1C 00 00 00                        MOV %EAX,COT+#28
 01F5 50                                    PUSH %EAX
 01F6 68 FF 00 00 00                        PUSH #255
 01FB E8 03 00                              CALL '_IMPSTRCPY' (EXTERN 3)
 01FE 83 C4 0C                              ADD %ESP,#12
 0201 E8 3B 00                              CALL 'PRINTSTRING' (EXTERN 59)
 0204 81 C4 00 01 00 00                     ADD %ESP,#256
    16      %repeat
 020A EB 00                                 JMP L1003
 020C                      L1004  EQU $
    17      newline
 020C E8 43 00                              CALL 'NEWLINE' (EXTERN 67)
    18    %repeat
 020F EB 00                                 JMP L1001
 0211                      L1002  EQU $
    19    newline
 0211 E8 43 00                              CALL 'NEWLINE' (EXTERN 67)
    20    %for i = 0, 1, 2 %cycle
 0214 C7 45 D0 FF FF FF FF                  MOV DWORD PTR [%EBP-48],#-1
 021B                      L1005  EQU $
 021B 8B 45 D0                              MOV %EAX,[%EBP-48]
 021E 3D 02 00 00 00                        CMP %EAX,#2
 0223 74 00                                 JE L1006
 0225 40                                    INC %EAX
 0226 89 45 D0                              MOV [%EBP-48],%EAX
    21      %for j = 0, 1, 1 %cycle
 0229 C7 45 CC FF FF FF FF                  MOV DWORD PTR [%EBP-52],#-1
 0230                      L1007  EQU $
 0230 8B 45 CC                              MOV %EAX,[%EBP-52]
 0233 3D 01 00 00 00                        CMP %EAX,#1
 0238 74 00                                 JE L1008
 023A 40                                    INC %EAX
 023B 89 45 CC                              MOV [%EBP-52],%EAX
    22        printstring("d2(");write(j,0);printstring(", ");write(i,0);printstring(") = "); write(d2(j,i),0);printstring(",  ");
 023E 81 EC 00 01 00 00                     SUB %ESP,#256
 0244 89 E0                                 MOV %EAX,%ESP
 0246 50                                    PUSH %EAX
 0247 B8 20 00 00 00                        MOV %EAX,COT+#32
 024C 50                                    PUSH %EAX
 024D 68 FF 00 00 00                        PUSH #255
 0252 E8 03 00                              CALL '_IMPSTRCPY' (EXTERN 3)
 0255 83 C4 0C                              ADD %ESP,#12
 0258 E8 3B 00                              CALL 'PRINTSTRING' (EXTERN 59)
 025B 81 C4 00 01 00 00                     ADD %ESP,#256
 0261 FF 75 CC                              PUSH DWORD PTR [%EBP-52]
 0264 6A 00                                 PUSH #0
 0266 E8 40 00                              CALL 'WRITE' (EXTERN 64)
 0269 83 C4 08                              ADD %ESP,#8
 026C 81 EC 00 01 00 00                     SUB %ESP,#256
 0272 89 E0                                 MOV %EAX,%ESP
 0274 50                                    PUSH %EAX
 0275 B8 24 00 00 00                        MOV %EAX,COT+#36
 027A 50                                    PUSH %EAX
 027B 68 FF 00 00 00                        PUSH #255
 0280 E8 03 00                              CALL '_IMPSTRCPY' (EXTERN 3)
 0283 83 C4 0C                              ADD %ESP,#12
 0286 E8 3B 00                              CALL 'PRINTSTRING' (EXTERN 59)
 0289 81 C4 00 01 00 00                     ADD %ESP,#256
 028F FF 75 D0                              PUSH DWORD PTR [%EBP-48]
 0292 6A 00                                 PUSH #0
 0294 E8 40 00                              CALL 'WRITE' (EXTERN 64)
 0297 83 C4 08                              ADD %ESP,#8
 029A 81 EC 00 01 00 00                     SUB %ESP,#256
 02A0 89 E0                                 MOV %EAX,%ESP
 02A2 50                                    PUSH %EAX
 02A3 B8 27 00 00 00                        MOV %EAX,COT+#39
 02A8 50                                    PUSH %EAX
 02A9 68 FF 00 00 00                        PUSH #255
 02AE E8 03 00                              CALL '_IMPSTRCPY' (EXTERN 3)
 02B1 83 C4 0C                              ADD %ESP,#12
 02B4 E8 3B 00                              CALL 'PRINTSTRING' (EXTERN 59)
 02B7 81 C4 00 01 00 00                     ADD %ESP,#256
 02BD FF 75 CC                              PUSH DWORD PTR [%EBP-52]
 02C0 FF 75 D0                              PUSH DWORD PTR [%EBP-48]
 02C3 FF 75 E0                              PUSH DWORD PTR [%EBP-32]
 02C6 E8 09 00                              CALL '_IMPAREF' (EXTERN 9)
 02C9 83 C4 0C                              ADD %ESP,#12
 02CC 89 C6                                 MOV %ESI,%EAX
 02CE 03 75 DC                              ADD %ESI,[%EBP-36]
 02D1 FF 36                                 PUSH DWORD PTR [%ESI]
 02D3 6A 00                                 PUSH #0
 02D5 E8 40 00                              CALL 'WRITE' (EXTERN 64)
 02D8 83 C4 08                              ADD %ESP,#8
 02DB 81 EC 00 01 00 00                     SUB %ESP,#256
 02E1 89 E0                                 MOV %EAX,%ESP
 02E3 50                                    PUSH %EAX
 02E4 B8 2C 00 00 00                        MOV %EAX,COT+#44
 02E9 50                                    PUSH %EAX
 02EA 68 FF 00 00 00                        PUSH #255
 02EF E8 03 00                              CALL '_IMPSTRCPY' (EXTERN 3)
 02F2 83 C4 0C                              ADD %ESP,#12
 02F5 E8 3B 00                              CALL 'PRINTSTRING' (EXTERN 59)
 02F8 81 C4 00 01 00 00                     ADD %ESP,#256
    23      %repeat
 02FE EB 00                                 JMP L1007
 0300                      L1008  EQU $
    24      newline
 0300 E8 43 00                              CALL 'NEWLINE' (EXTERN 67)
    25    %repeat
 0303 EB 00                                 JMP L1005
 0305                      L1006  EQU $
    26    newline
 0305 E8 43 00                              CALL 'NEWLINE' (EXTERN 67)
    27  %endofprogram
 0308 C9                                    LEAVE
 0309 C3                                    RET

    50 Statements compiled



 ELF object file generated from IMP source file: '/home/gtoal/src/compilers101/new-parser/imps/tests/test119.imp'
 +----------+---------------------+---------+---------+---------+------------+
 | Sections |       Symbols       | Code    | Data    | Diag    | Total size |
 +----------+----------+----------+---------+---------+---------+------------+
 |  (count) | Internal | External | (bytes) | (bytes) | (bytes) | (bytes)    |
 +----------+----------+----------+---------+---------+---------+------------+
 |       13 |        6 |       12 |     868 |      72 |      32 |        972 |
 +----------+----------+----------+---------+---------+---------+------------+


