It looks like you're new here. If you want to get involved, click one of these buttons!
.data
.comm mmap_, 24
.text
.macro alloc length
#prepare params for mmap
movl $0, mmap_ # 0- Startadress gets selected from Kernel
movl \length, mmap_+4 #size of Adressrange
movl $3, mmap_+8 #PROT_WITE / PROT_READ 0x02, 0x01
movl $34, mmap_+12 #map anonymously (0x20), map_private(0x20)
movl $-1, mmap_+16 #fd -1 portability
movl $0, mmap_+20 # offset ignored
#allocate memory
movl $90, %eax
leal mmap_ , %ebx
int $0x80
.endm
.macro free address length
movl $91, %eax
movl \address, %ebx
movl \length, %ecx
int $0x80
.endm