Write an ARM assembly language program that use the malloc f
Write an ARM assembly language program that use the malloc function to request dynamic allocation of memory from the operating system until the operating system will not allocate any more.
Solution
mov edi ,5; //some 5bytes of memory
extern malloc
call malloc
; rax points to our newly allocated memory
mov ecx,7; set up a constant
mov[rax],ecx;
mov edx[rax];
mov eax,edx,
ret
