Question: ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;DEFINITIONS;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; % define LOAD _ ADDRESS 0 x 0 0 0 2 0 0 0 0 ; pretty much any number > 0

;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;DEFINITIONS;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
%define LOAD_ADDRESS 0x00020000 ; pretty much any number >0 works
%define CODE_SIZE END-(LOAD_ADDRESS+0x78) ; everything beyond the HEADER is code
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;HEADER;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
BITS 64
org LOAD_ADDRESS
ELF_HEADER:
db 0x7F,"ELF" ; magic number to indicate ELF file
db 0x02 ; 0x1 for 32-bit, 0x2 for 64-bit
db 0x01 ; 0x1 for little endian, 0x2 for big endian
db 0x01 ; 0x1 for current version of ELF
db 0x09 ; 0x9 for FreeBSD, 0x3 for Linux (doesn't seem to matter)
db 0x00 ; ABI version (ignored?)
times 7 db 0x00 ; 7 padding bytes
dw 0x0002 ; executable file
dw 0x003E ; AMD x86-64
dd 0x00000001 ; version 1
dq START ; entry point for our program
dq 0x0000000000000040 ; 0x40 offset from ELF_HEADER to PROGRAM_HEADER
dq 0x0000000000000000 ; section header offset (we don't have this)
dd 0x00000000 ; unused flags
dw 0x0040 ; 64-byte size of ELF_HEADER
dw 0x0038 ; 56-byte size of each program header entry
dw 0x0001 ; number of program header entries (we have one)
dw 0x0000 ; size of each section header entry (none)
dw 0x0000 ; number of section header entries (none)
dw 0x0000 ; index in section header table for section names (waste)
PROGRAM_HEADER:
dd 0x00000001 ; 0x1 for loadable program segment
dd 0x00000007 ; read/write/execute flags
dq 0x0000000000000078 ; offset of code start in file image (0x40+0x38)
dq LOAD_ADDRESS+0x78 ; virtual address of segment in memory
dq 0x0000000000000000 ; physical address of segment in memory (ignored?)
dq CODE_SIZE ; size (bytes) of segment in file image
dq CODE_SIZE ; size (bytes) of segment in memory
dq 0x0000000000000000 ; alignment (doesn't matter, only 1 segment)
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;INCLUDES;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
%include "syscalls.asm" ;
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;INSTRUCTIONS;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
START:
; delete the input file
mov rdi,[SYS_ARGC_START_POINTER+16] ; command line arg
mov al,SYS_UNLINK
syscall
mov al,SYS_EXIT
syscall
END:why erro 139 is here ?

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Programming Questions!