         Edinburgh IMP77 Compiler - Version 8.4-2024.12.18

     1  %BEGIN
 0000 C8 00 00 01                           ENTER 0000,1
     2    %INTEGERARRAY BAD(1: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 02 00 00 00                  MOV DWORD PTR [%EBP-12],#2
 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 89 DC                                 MOV %ESP,%EBX
     3    %INTEGER I,J
     4    %ON %EVENT 0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15 %START
 003B 89 65 D8                              MOV [%EBP-40],%ESP
 003E EB 00                                 JMP L1001
 0040                      L1002  EQU $
 0040 8B 65 D8                              MOV %ESP,[%EBP-40]
     5      PRINT STRING("TRAPPED!"); NEWLINE
 0043 81 EC 00 01 00 00                     SUB %ESP,#256
 0049 89 E0                                 MOV %EAX,%ESP
 004B 50                                    PUSH %EAX
 004C B8 00 00 00 00                        MOV %EAX,COT+#0
 0051 50                                    PUSH %EAX
 0052 68 FF 00 00 00                        PUSH #255
 0057 E8 03 00                              CALL '_IMPSTRCPY' (EXTERN 3)
 005A 83 C4 0C                              ADD %ESP,#12
 005D E8 3B 00                              CALL 'PRINTSTRING' (EXTERN 59)
 0060 81 C4 00 01 00 00                     ADD %ESP,#256
 0066 E8 43 00                              CALL 'NEWLINE' (EXTERN 67)
     6      %STOP
 0069 B8 06 00 00 00                        MOV %EAX,#6
 006E 50                                    PUSH %EAX
 006F 31 C0                                 XOR %EAX,%EAX
 0071 50                                    PUSH %EAX
 0072 31 C0                                 XOR %EAX,%EAX
 0074 50                                    PUSH %EAX
 0075 31 C0                                 XOR %EAX,%EAX
 0077 50                                    PUSH %EAX
 0078 E8 0B 00                              CALL '_IMPSIGNAL' (EXTERN 11)
 007B 83 C4 10                              ADD %ESP,#16
     7    %FINISH
 007E                      L1001  EQU $
     8    BAD(0) = 123
 007E 6A 00                                 PUSH #0
 0080 FF 75 E8                              PUSH DWORD PTR [%EBP-24]
 0083 E8 09 00                              CALL '_IMPAREF' (EXTERN 9)
 0086 83 C4 08                              ADD %ESP,#8
 0089 89 C6                                 MOV %ESI,%EAX
 008B 03 75 E4                              ADD %ESI,[%EBP-28]
 008E C7 06 7B 00 00 00                     MOV DWORD PTR [%ESI],#123
     9    BAD(1) = 234
 0094 6A 01                                 PUSH #1
 0096 FF 75 E8                              PUSH DWORD PTR [%EBP-24]
 0099 E8 09 00                              CALL '_IMPAREF' (EXTERN 9)
 009C 83 C4 08                              ADD %ESP,#8
 009F 89 C7                                 MOV %EDI,%EAX
 00A1 03 7D E4                              ADD %EDI,[%EBP-28]
 00A4 C7 07 EA 00 00 00                     MOV DWORD PTR [%EDI],#234
    10    J = 1
 00AA C7 45 DC 01 00 00 00                  MOV DWORD PTR [%EBP-36],#1
    11    %CYCLE
 00B1                      L1003  EQU $
    12      I = J + BAD(J)
 00B1 FF 75 DC                              PUSH DWORD PTR [%EBP-36]
 00B4 FF 75 E8                              PUSH DWORD PTR [%EBP-24]
 00B7 E8 09 00                              CALL '_IMPAREF' (EXTERN 9)
 00BA 83 C4 08                              ADD %ESP,#8
 00BD 89 C3                                 MOV %EBX,%EAX
 00BF 03 5D E4                              ADD %EBX,[%EBP-28]
 00C2 8B 45 DC                              MOV %EAX,[%EBP-36]
 00C5 03 03                                 ADD %EAX,[%EBX]
 00C7 89 45 E0                              MOV [%EBP-32],%EAX
    13      PRINTSTRING("I = "); WRITE(I,0); NEWLINE
 00CA 81 EC 00 01 00 00                     SUB %ESP,#256
 00D0 89 E0                                 MOV %EAX,%ESP
 00D2 50                                    PUSH %EAX
 00D3 B8 09 00 00 00                        MOV %EAX,COT+#9
 00D8 50                                    PUSH %EAX
 00D9 68 FF 00 00 00                        PUSH #255
 00DE E8 03 00                              CALL '_IMPSTRCPY' (EXTERN 3)
 00E1 83 C4 0C                              ADD %ESP,#12
 00E4 E8 3B 00                              CALL 'PRINTSTRING' (EXTERN 59)
 00E7 81 C4 00 01 00 00                     ADD %ESP,#256
 00ED FF 75 E0                              PUSH DWORD PTR [%EBP-32]
 00F0 6A 00                                 PUSH #0
 00F2 E8 40 00                              CALL 'WRITE' (EXTERN 64)
 00F5 83 C4 08                              ADD %ESP,#8
 00F8 E8 43 00                              CALL 'NEWLINE' (EXTERN 67)
    14      I = J * BAD(1)
 00FB 6A 01                                 PUSH #1
 00FD FF 75 E8                              PUSH DWORD PTR [%EBP-24]
 0100 E8 09 00                              CALL '_IMPAREF' (EXTERN 9)
 0103 83 C4 08                              ADD %ESP,#8
 0106 89 C6                                 MOV %ESI,%EAX
 0108 03 75 E4                              ADD %ESI,[%EBP-28]
 010B 8B 45 DC                              MOV %EAX,[%EBP-36]
 010E F7 2E                                 IMUL DWORD PTR [%ESI]
 0110 89 45 E0                              MOV [%EBP-32],%EAX
    15      I = BAD(J)
 0113 FF 75 DC                              PUSH DWORD PTR [%EBP-36]
 0116 FF 75 E8                              PUSH DWORD PTR [%EBP-24]
 0119 E8 09 00                              CALL '_IMPAREF' (EXTERN 9)
 011C 83 C4 08                              ADD %ESP,#8
 011F 89 C7                                 MOV %EDI,%EAX
 0121 03 7D E4                              ADD %EDI,[%EBP-28]
 0124 8B 3F                                 MOV %EDI,[%EDI]
 0126 89 7D E0                              MOV [%EBP-32],%EDI
    16      I = BAD(1)
 0129 6A 01                                 PUSH #1
 012B FF 75 E8                              PUSH DWORD PTR [%EBP-24]
 012E E8 09 00                              CALL '_IMPAREF' (EXTERN 9)
 0131 83 C4 08                              ADD %ESP,#8
 0134 89 C3                                 MOV %EBX,%EAX
 0136 03 5D E4                              ADD %EBX,[%EBP-28]
 0139 8B 1B                                 MOV %EBX,[%EBX]
 013B 89 5D E0                              MOV [%EBP-32],%EBX
    17      J = J+1
 013E FF 45 DC                              INC DWORD PTR [%EBP-36]
    18    %REPEAT
 0141 EB 00                                 JMP L1003
    19  %ENDOFPROGRAM

    22 Statements compiled



 ELF object file generated from IMP source file: '/home/gtoal/src/compilers101/new-parser/imps/tests/test131.imp'
 +----------+---------------------+---------+---------+---------+------------+
 | Sections |       Symbols       | Code    | Data    | Diag    | Total size |
 +----------+----------+----------+---------+---------+---------+------------+
 |  (count) | Internal | External | (bytes) | (bytes) | (bytes) | (bytes)    |
 +----------+----------+----------+---------+---------+---------+------------+
 |       12 |        5 |       13 |     356 |      14 |      32 |        402 |
 +----------+----------+----------+---------+---------+---------+------------+


