nop mov rdi, [buf] ; EPILOGUE call _free %ifdef OUTPUT_LAST_CELL lea rdi, [strbuf64] ; snprintf(strbuf64,64,LCRformatstr,maxp-buf) mov esi, 64 lea rdx, [LCRformatstr] mov rcx, qword [maxp] sub rcx, qword [buf] call _snprintf mov edi, 2 lea rsi, [strbuf64] mov edx, eax call _write %endif %ifdef HEATMAPFNAME lea rdi, [HMfname] lea rsi, [HMfmode] call _fopen cmp rax, 0 jz fopenerror mov r13, rax ;file pointer mov ebx, 0 ;loop counter hmloop: mov rdi, r13 lea rsi, [HMformatstr] mov edx, ebx mov ecx, dword [r12+4*rbx] call _fprintf inc ebx cmp ebx, SOURCE_LENGTH jl hmloop mov rdi, r13 call _fclose %endif xor eax, eax mainend: pop r13 pop r13 pop r12 pop rbx mov rsp, rbp pop rbp ret nomem: mov edi, 2 lea rsi, [nomemstr] mov rdx, nomemstr.len call _write mov eax, 1 jmp mainend fopenerror: lea rdi, [fopenstr] call _perror mov eax, 1 jmp mainend section .data sectalign 8 nomemstr: db "Out of memory!" .len: equ $-nomemstr %ifdef OUTPUT_LAST_CELL LCRformatstr: db "Last cell reached: %d", 10, 0 align 8, db 0 maxp: dq 0 %endif %ifdef HEATMAPFNAME fopenstr: db "fopen", 0 HMfname: db HEATMAPFNAME HMfmode: db "w", 0 HMformatstr: db "%d %d", 10, 0 %endif section .bss sectalign 8 buf: resq 1 strbuf64: resb 64