Argument passing
Posted: Mon Aug 29, 2022 3:02 pm
Hello, guys!
I have problem with passing arguments to user mode process. If i do this:
All works fine, but if i try to add something to the allocated stack, the stack are brokes:
The first poping from stack are zero, i use this code for checking valid of stack:
And program always jumps to exit label, this means that after the poping from stack done, the register eax are zero.
What i am doing wrong?
I have problem with passing arguments to user mode process. If i do this:
Code: Select all
int *stack = (int *)fr->usersp+4;
Code: Select all
frame->usersp = (isUser ? ((int)pmml_alloc(true)+4096) : 0);
Code: Select all
pop eax
; Check if argument exists
cmp eax,0
je .exit
What i am doing wrong?