         Edinburgh IMP77 Compiler - Version 8.4-2024.12.18

     1  %permintegerfnspec  int pt(%real r)
     2  %begin
 0000 C8 00 00 01                           ENTER 0000,1
     3    %integer x
     4  
     5    x = 2 * 3 + 4       ;! no extra brackets when Imp precedence matches C precedence
 0004 C7 45 F8 0A 00 00 00                  MOV DWORD PTR [%EBP-8],#10
     6  
     7    x = 2 * ( 3 + 4)    ;! explicit brackets are honoured
 000B C7 45 F8 0E 00 00 00                  MOV DWORD PTR [%EBP-8],#14
     8    x = (2 * 3) + 4
 0012 C7 45 F8 0A 00 00 00                  MOV DWORD PTR [%EBP-8],#10
     9  
    10    x = 1 & 2 + 3 & 4   ;! an Imp to C gotcha!
 0019 C7 45 F8 00 00 00 00                  MOV DWORD PTR [%EBP-8],#0
    11  
    12    x = 123 & 12 + 234 ! 23 * 345 !! 34 - 45 - INTPT(1.5 ^ 2 / 5.0) << 2 >> 3 ^^ 2 ^^ 2
 0020 DD 05 00 00 00 00                     FLD QWORD [COT+0000]
 0026 B8 02 00 00 00                        MOV %EAX,#2
 002B 50                                    PUSH %EAX
 002C 83 EC 08                              SUB %ESP,#8
 002F 89 E6                                 MOV %ESI,%ESP
 0031 DD 1E                                 FSTP QWORD [%ESI]
 0033 E8 02 00                              CALL '_IMPFEXP' (EXTERN 2)
 0036 83 C4 0C                              ADD %ESP,#12
 0039 DD 05 08 00 00 00                     FLD QWORD [COT+0008]
 003F DE F9                                 FDIVP ST(1),ST
 0041 83 EC 04                              SUB %ESP,#4
 0044 89 E7                                 MOV %EDI,%ESP
 0046 D9 1F                                 FSTP DWORD [%EDI]
 0048 E8 6E 00                              CALL 'INTPT' (EXTERN 110)
 004B 83 C4 04                              ADD %ESP,#4
 004E C1 E0 02                              SHL %EAX,#2
 0051 C1 E8 03                              SHR %EAX,#3
 0054 89 45 F4                              MOV [%EBP-12],%EAX
 0057 F7 6D F4                              IMUL DWORD PTR [%EBP-12]
 005A 89 45 F0                              MOV [%EBP-16],%EAX
 005D F7 6D F0                              IMUL DWORD PTR [%EBP-16]
 0060 B9 B0 1E 00 00                        MOV %ECX,#7856
 0065 29 C1                                 SUB %ECX,%EAX
 0067 89 4D F8                              MOV [%EBP-8],%ECX
    13  
    14  %endofprogram
 006A C9                                    LEAVE
 006B C3                                    RET

     9 Statements compiled



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


