mirror of
https://github.com/samsonjs/compiler.git
synced 2026-03-25 08:45:52 +00:00
The supporting infrastructure includes a C program for reading a binary blob of x86 code and wrapping it in an ELF executable for Linux x86. Unsure about getting the data for other sections of the binary besides .text.
13 lines
214 B
NASM
13 lines
214 B
NASM
BITS 32
|
|
GLOBAL _start
|
|
SECTION .data
|
|
{data}
|
|
SECTION .bss
|
|
{bss}
|
|
SECTION .text
|
|
_start:
|
|
{code}
|
|
;; The result in eax is the exit code, move it to ebx.
|
|
mov ebx, eax
|
|
mov eax, 1 ; _exit syscall
|
|
int 0x80 ; call Linux
|