         Edinburgh IMP77 Compiler - Version 8.4-2024.12.18

     1  %begin
 0000 C8 00 00 01                           ENTER 0000,1
     2    %recordformat fredfm (%integer a, %real b, %integer c)
     3    %record (fredfm) fred = 0
 0004 8D 7D F0                              LEA %EDI,[%EBP-16]
 0007 B9 0C 00 00 00                        MOV %ECX,#12
 000C 31 C0                                 XOR %EAX,%EAX
 000E F3 AA                                 REP STOSB
     4    ! NOT ALLOWED: %record (fredfm) %name fredp == 0
     5    ! NOT ALLOWED: %record (fredfm) %name fredp = 0
     6    %record (fredfm) %name fredp == RECORD(0)
 0010 C7 45 EC 00 00 00 00                  MOV DWORD PTR [%EBP-20],#0
     7  
     8    %on %event * %start
 0017 89 65 E8                              MOV [%EBP-24],%ESP
 001A EB 00                                 JMP L1001
 001C                      L1002  EQU $
 001C 8B 65 E8                              MOV %ESP,[%EBP-24]
     9      ! does not trap SIGSEGV !
    10      write(event_event,0); newline
 001F E8 18 00                              CALL 'EVENT' (EXTERN 24)
 0022 FF 30                                 PUSH DWORD PTR [%EAX]
 0024 6A 00                                 PUSH #0
 0026 E8 40 00                              CALL 'WRITE' (EXTERN 64)
 0029 83 C4 08                              ADD %ESP,#8
 002C E8 43 00                              CALL 'NEWLINE' (EXTERN 67)
    11      %stop
 002F B8 0B 00 00 00                        MOV %EAX,#11
 0034 50                                    PUSH %EAX
 0035 31 C0                                 XOR %EAX,%EAX
 0037 50                                    PUSH %EAX
 0038 31 C0                                 XOR %EAX,%EAX
 003A 50                                    PUSH %EAX
 003B 31 C0                                 XOR %EAX,%EAX
 003D 50                                    PUSH %EAX
 003E E8 0B 00                              CALL '_IMPSIGNAL' (EXTERN 11)
 0041 83 C4 10                              ADD %ESP,#16
    12    %finish
 0044                      L1001  EQU $
    13    
    14    fred_a = 1; fred_b = 1.1; fred_c = 1
 0044 C7 45 F0 01 00 00 00                  MOV DWORD PTR [%EBP-16],#1
 004B DD 05 00 00 00 00                     FLD QWORD [COT+0000]
 0051 D9 5D F4                              FSTP DWORD [%EBP-12]
 0054 C7 45 F8 01 00 00 00                  MOV DWORD PTR [%EBP-8],#1
    15    write(fred_a,0); write(fred_c,3); newline
 005B FF 75 F0                              PUSH DWORD PTR [%EBP-16]
 005E 6A 00                                 PUSH #0
 0060 E8 40 00                              CALL 'WRITE' (EXTERN 64)
 0063 83 C4 08                              ADD %ESP,#8
 0066 FF 75 F8                              PUSH DWORD PTR [%EBP-8]
 0069 6A 03                                 PUSH #3
 006B E8 40 00                              CALL 'WRITE' (EXTERN 64)
 006E 83 C4 08                              ADD %ESP,#8
 0071 E8 43 00                              CALL 'NEWLINE' (EXTERN 67)
    16    fred = 0
 0074 8D 7D F0                              LEA %EDI,[%EBP-16]
 0077 B9 0C 00 00 00                        MOV %ECX,#12
 007C 31 C0                                 XOR %EAX,%EAX
 007E F3 AA                                 REP STOSB
    17    write(fred_a,0); write(fred_c,3); newline
 0080 FF 75 F0                              PUSH DWORD PTR [%EBP-16]
 0083 6A 00                                 PUSH #0
 0085 E8 40 00                              CALL 'WRITE' (EXTERN 64)
 0088 83 C4 08                              ADD %ESP,#8
 008B FF 75 F8                              PUSH DWORD PTR [%EBP-8]
 008E 6A 03                                 PUSH #3
 0090 E8 40 00                              CALL 'WRITE' (EXTERN 64)
 0093 83 C4 08                              ADD %ESP,#8
 0096 E8 43 00                              CALL 'NEWLINE' (EXTERN 67)
    18  
    19    fredp == fred
 0099 8D 45 F0                              LEA %EAX,[%EBP-16]
 009C 89 45 EC                              MOV [%EBP-20],%EAX
    20    fred_a = 1; fred_b = 1.1; fred_c = 1
 009F C7 45 F0 01 00 00 00                  MOV DWORD PTR [%EBP-16],#1
 00A6 DD 05 00 00 00 00                     FLD QWORD [COT+0000]
 00AC D9 5D F4                              FSTP DWORD [%EBP-12]
 00AF C7 45 F8 01 00 00 00                  MOV DWORD PTR [%EBP-8],#1
    21    write(fredp_a,0); write(fredp_c,3); newline
 00B6 8B 75 EC                              MOV %ESI,[%EBP-20]
 00B9 FF 36                                 PUSH DWORD PTR [%ESI]
 00BB 6A 00                                 PUSH #0
 00BD E8 40 00                              CALL 'WRITE' (EXTERN 64)
 00C0 83 C4 08                              ADD %ESP,#8
 00C3 8B 7D EC                              MOV %EDI,[%EBP-20]
 00C6 FF 77 08                              PUSH DWORD PTR [%EDI+8]
 00C9 6A 03                                 PUSH #3
 00CB E8 40 00                              CALL 'WRITE' (EXTERN 64)
 00CE 83 C4 08                              ADD %ESP,#8
 00D1 E8 43 00                              CALL 'NEWLINE' (EXTERN 67)
    22  
    23    fredp = 0
 00D4 8B 7D EC                              MOV %EDI,[%EBP-20]
 00D7 B9 0C 00 00 00                        MOV %ECX,#12
 00DC 31 C0                                 XOR %EAX,%EAX
 00DE F3 AA                                 REP STOSB
    24    write(fred_a,0); write(fred_c,3); newline
 00E0 FF 75 F0                              PUSH DWORD PTR [%EBP-16]
 00E3 6A 00                                 PUSH #0
 00E5 E8 40 00                              CALL 'WRITE' (EXTERN 64)
 00E8 83 C4 08                              ADD %ESP,#8
 00EB FF 75 F8                              PUSH DWORD PTR [%EBP-8]
 00EE 6A 03                                 PUSH #3
 00F0 E8 40 00                              CALL 'WRITE' (EXTERN 64)
 00F3 83 C4 08                              ADD %ESP,#8
 00F6 E8 43 00                              CALL 'NEWLINE' (EXTERN 67)
    25  
    26  ! NOT ALLOWED: fredp == 0
    27    fredp == RECORD(0)
 00F9 C7 45 EC 00 00 00 00                  MOV DWORD PTR [%EBP-20],#0
    28    !write(fredp_a,0); write(fredp_c,3); newline ;! "Segmentation fault" as expected
    29  %endofprogram
 0100 C9                                    LEAVE
 0101 C3                                    RET

    32 Statements compiled



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


