From 8a42e9b49b2f3b3521d9158a7df4b056eac43a9b Mon Sep 17 00:00:00 2001 From: Andreas Baumann Date: Thu, 23 Jul 2020 15:53:07 +0200 Subject: added a simple ELF/i386 header example in FASM syntax --- ecomp-c/tests/asm-i386/elf.asm | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/ecomp-c/tests/asm-i386/elf.asm b/ecomp-c/tests/asm-i386/elf.asm index 16f40e1..e23f61d 100644 --- a/ecomp-c/tests/asm-i386/elf.asm +++ b/ecomp-c/tests/asm-i386/elf.asm @@ -26,14 +26,17 @@ phdr: dd 1 ; e_type: PT_LOAD dd 0 ; e_offset dd $$ ; p_vaddr -dd 0 ; p_paddr +dd $$ ; p_paddr dd filesize ; p_filesz dd filesize ; p_memsz -dd 5 ; p_flags: Read & Execute +dd 7 ; p_flags: Read, Write & Execute dd 0x1000 ; p_align phdrsize = $ - phdr _start: +mov eax, 42 +mov [a], eax mov eax, 1 -mov ebx, 42 +mov ebx, [a] int $80 +a: dd 43 filesize = $ - $$ -- cgit v1.2.3-54-g00ecf