I read a book that write the next program in C, and convet the call of this function to assembler code:

```
int *p;    /* pointer to integer */
int foo (int n, int *q) {}
/* function get int and pointer to int, returns int */
/* Now, let's call the function: */    
*p = foo (*p, p);

```

It convert to:

```
MOV EBX, [P]
PUSH EBX
PUSH DWORD [EBX]
CALL foo
MOV EBX, [P]
MOV [EBX], EAX
ADD ESP, 8

```

I didn't understood why it is correct, as I understood it the code should looks like this:

```
MOV EBX, P   ;; **CHANGE**
PUSH EBX
PUSH DWORD [EBX]
CALL foo
MOV EBX, P ;; **CHANGE**
MOV [EBX], EAX
ADD ESP, 8

```

and that because P is a pointer. If we do `MOV EBX, [P]`, as the book suggest, we got the integer number (Not the adress), and then if we do `PUSH DWORD [EBX]`, we got illigal instruction.

Where i'm wrong?