         Edinburgh IMP77 Compiler - Version 8.4-2024.12.18

     1  { > IMP.intmath }
     2  %begin
 0000 C8 00 00 01                           ENTER 0000,1
     3  %integer i,x,y
     4    x = 0
 0004 C7 45 F4 00 00 00 00                  MOV DWORD PTR [%EBP-12],#0
     5    y = 9
 000B C7 45 F0 09 00 00 00                  MOV DWORD PTR [%EBP-16],#9
     6    print string("Start
     7+ ")
 0012 81 EC 00 01 00 00                     SUB %ESP,#256
 0018 89 E0                                 MOV %EAX,%ESP
 001A 50                                    PUSH %EAX
 001B B8 00 00 00 00                        MOV %EAX,COT+#0
 0020 50                                    PUSH %EAX
 0021 68 FF 00 00 00                        PUSH #255
 0026 E8 03 00                              CALL '_IMPSTRCPY' (EXTERN 3)
 0029 83 C4 0C                              ADD %ESP,#12
 002C E8 3B 00                              CALL 'PRINTSTRING' (EXTERN 59)
 002F 81 C4 00 01 00 00                     ADD %ESP,#256
     8    %for i = 1, 1, 100000 %cycle
 0035 C7 45 F8 00 00 00 00                  MOV DWORD PTR [%EBP-8],#0
 003C                      L1001  EQU $
 003C 8B 45 F8                              MOV %EAX,[%EBP-8]
 003F 3D A0 86 01 00                        CMP %EAX,#100000
 0044 74 00                                 JE L1002
 0046 40                                    INC %EAX
 0047 89 45 F8                              MOV [%EBP-8],%EAX
     9      x = x + (y * y - y) // y
 004A 8B 45 F0                              MOV %EAX,[%EBP-16]
 004D F7 6D F0                              IMUL DWORD PTR [%EBP-16]
 0050 2B 45 F0                              SUB %EAX,[%EBP-16]
 0053 99                                    CWD
 0054 F7 7D F0                              IDIV DWORD PTR [%EBP-16]
 0057 01 45 F4                              ADD [%EBP-12],%EAX
    10    %repeat
 005A EB 00                                 JMP L1001
 005C                      L1002  EQU $
    11    print string("Finish
    12+ ")
 005C 81 EC 00 01 00 00                     SUB %ESP,#256
 0062 89 E0                                 MOV %EAX,%ESP
 0064 50                                    PUSH %EAX
 0065 B8 07 00 00 00                        MOV %EAX,COT+#7
 006A 50                                    PUSH %EAX
 006B 68 FF 00 00 00                        PUSH #255
 0070 E8 03 00                              CALL '_IMPSTRCPY' (EXTERN 3)
 0073 83 C4 0C                              ADD %ESP,#12
 0076 E8 3B 00                              CALL 'PRINTSTRING' (EXTERN 59)
 0079 81 C4 00 01 00 00                     ADD %ESP,#256
    13    Write(x,1)
 007F FF 75 F4                              PUSH DWORD PTR [%EBP-12]
 0082 6A 01                                 PUSH #1
 0084 E8 40 00                              CALL 'WRITE' (EXTERN 64)
 0087 83 C4 08                              ADD %ESP,#8
    14    new line
 008A E8 43 00                              CALL 'NEWLINE' (EXTERN 67)
    15  %end %of %programm
 008D C9                                    LEAVE
 008E C3                                    RET
    12 Statements compiled



 ELF object file generated from IMP source file: '/home/gtoal/src/compilers101/new-parser/imps/tests/intmath.imp'
 +----------+---------------------+---------+---------+---------+------------+
 | Sections |       Symbols       | Code    | Data    | Diag    | Total size |
 +----------+----------+----------+---------+---------+---------+------------+
 |  (count) | Internal | External | (bytes) | (bytes) | (bytes) | (bytes)    |
 +----------+----------+----------+---------+---------+---------+------------+
 |       12 |        5 |       10 |     155 |      16 |      32 |        203 |
 +----------+----------+----------+---------+---------+---------+------------+


