How to Dynamically Allocate Memory Using Assembly and System Calls Under Linux
On Linux mmap2 is a sensible system call to use for this at a low level. It takes 6 arguments, so in IA32 you can call it using: mov eax, 192 ; mmap2 xor ebx, ebx ; addr = NULL mov ecx, 4096 ; len = 4096 mov edx, $7 ; prot = PROT_READ|PROT_WRITE|PROT_EXEC mov …