I use the nasm compiler to compile my code into an object file, and then the gcc linker is called to link this object file in order to create the final executable. This means that I have access to the C runtime libraries.
I need to do dynamic memory allocation, so I am making a malloc call as follows
push 20 ;push amount of bytes malloc should allocate
call _malloc ;call malloc
add esp,4 ;undo push
The allocated memory address is returned in the eax register, but how can I use the address to initialize this position with values?
The goal of my program is to indicate how many digits they want to enter, and then dynamically create space for each number. Ideally, I hope to create an array that matches the exact size specified by the user and can iterate through this array.
source
share