         Edinburgh IMP77 Compiler - Version 8.4-2024.12.18

     1  %begin
 0000 C8 00 00 01                           ENTER 0000,1
     2    %integer btrue, bfalse, instring
     3    %integer ch, inconst, ptr, obp, res
     4    %integerarray sc('A':'Z')
 0004 C7 45 CC 01 00 00 00                  MOV DWORD PTR [%EBP-52],#1
 000B C7 45 D0 41 00 00 00                  MOV DWORD PTR [%EBP-48],#65
 0012 C7 45 D4 5A 00 00 00                  MOV DWORD PTR [%EBP-44],#90
 0019 C7 45 D8 83 00 00 00                  MOV DWORD PTR [%EBP-40],#131
 0020 8D 45 CC                              LEA %EAX,[%EBP-52]
 0023 50                                    PUSH %EAX
 0024 E8 0A 00                              CALL '_IMPADEF' (EXTERN 10)
 0027 83 C4 04                              ADD %ESP,#4
 002A 8D 4D CC                              LEA %ECX,[%EBP-52]
 002D 89 E3                                 MOV %EBX,%ESP
 002F 29 D3                                 SUB %EBX,%EDX
 0031 89 5D C4                              MOV [%EBP-60],%EBX
 0034 89 4D C8                              MOV [%EBP-56],%ECX
 0037 01 C3                                 ADD %EBX,%EAX
 0039 89 DC                                 MOV %ESP,%EBX
     5    %bytearray outbuf(0:1000)
 003B C7 45 B4 01 00 00 00                  MOV DWORD PTR [%EBP-76],#1
 0042 C7 45 B8 00 00 00 00                  MOV DWORD PTR [%EBP-72],#0
 0049 C7 45 BC E8 03 00 00                  MOV DWORD PTR [%EBP-68],#1000
 0050 C7 45 C0 2B 00 00 00                  MOV DWORD PTR [%EBP-64],#43
 0057 8D 45 B4                              LEA %EAX,[%EBP-76]
 005A 50                                    PUSH %EAX
 005B E8 0A 00                              CALL '_IMPADEF' (EXTERN 10)
 005E 83 C4 04                              ADD %ESP,#4
 0061 8D 4D B4                              LEA %ECX,[%EBP-76]
 0064 89 E3                                 MOV %EBX,%ESP
 0066 29 D3                                 SUB %EBX,%EDX
 0068 89 5D AC                              MOV [%EBP-84],%EBX
 006B 89 4D B0                              MOV [%EBP-80],%ECX
 006E 01 C3                                 ADD %EBX,%EAX
 0070 81 E3 FC FF FF FF                     AND %EBX,#-4
 0076 89 DC                                 MOV %ESP,%EBX
     6    
     7    %routine getline(%integer ptr)
 0078 EB 00                                 JMP L1001
 007A                      L1002  EQU $
 007A C8 00 00 02                           ENTER 0000,2
     8    %end
 007E C9                                    LEAVE
 007F C3                                    RET
 0080                      L1001  EQU $
?PTR unused
     9    %integerfn next non sp(%integer sym)
    10      %result = 'x'
 0080                      L1003  EQU $
 0080 C8 00 00 02                           ENTER 0000,2
 0084 B8 78 00 00 00                        MOV %EAX,#120
 0089 C9                                    LEAVE
 008A C3                                    RET
    11    %end
 008B                      L1001  EQU $
?SYM unused
    12    %switch bip(1:2000)
    13    
 008B                      L1004  EQU $
    14  bip(1013): ! Alias.
    15     ch = next non sp(inconst)
    16     ptr = ptr + 1
    17     %if ch # '"' %then res = bfalse %and -> inc
    18     outbuf(obp) = ' '
    19     obp = obp + 1
    20     outbuf(obp) = '"'
    21     obp = obp + 1
    22     %cycle 
    23        %if sc(ptr) = '"' %start
    24           outbuf(obp) = '"' ! instring
    25           %if sc(ptr + 1) # '"' %then %exit
    26           outbuf(obp + 1) = '"' ! instring
    27           obp = obp + 2
    28           ptr = ptr + 2
    29        %finish %else %start
    30           ch = sc(ptr)
    31           outbuf(obp) = ch ! instring
    32           obp = obp + 1
    33           ptr = ptr + 1
    34           getline(ptr) %if ch = nl
    35        %finish
    36     %repeat
    37     ptr = ptr + 1
    38     obp = obp + 1
    39  inc:
    40  %endofprogram
?BTRUE unused

    36 Statements compiled



 ELF object file generated from IMP source file: '/home/gtoal/src/compilers101/new-parser/imps/tests/test99.imp'
 +----------+---------------------+---------+---------+---------+------------+
 | Sections |       Symbols       | Code    | Data    | Diag    | Total size |
 +----------+----------+----------+---------+---------+---------+------------+
 |  (count) | Internal | External | (bytes) | (bytes) | (bytes) | (bytes)    |
 +----------+----------+----------+---------+---------+---------+------------+
 |       11 |        6 |        7 |     143 |       0 |      96 |        239 |
 +----------+----------+----------+---------+---------+---------+------------+


