Based on Microsoft MASM Documentation, the usage of .STACK directive is
When used with .MODEL, defines a stack segment (with segment name STACK). The optional size specifies the number of bytes for the stack (default 1,024). The .STACK directive automatically closes the stack statement. (32-bit MASM only.)
For the sake of experimentation, I made the .STACK to allocate 1,073,741,824 bytes (1 GB)
Note that I'm running the code in Visual Studio 2013, console project.
.586
.MODEL FLAT
.STACK 1073741824
.DATA
a DWORD 50
b DWORD 55
.CODE
main PROC
    addLoop: mov eax, a
    push eax
    mov eax, 0
    mov ebx, b
    push ebx
    jmp addLoop
    RET
main ENDP
END
The code will overflow the stack. What I did was I noted down the first address of the ESP register, let the code run until overflowed, and took the final ESP to be subtracted from the first one to get the size of the stack.
In my context, it's 00DAFEE4 - 00CB3000 + 1 = 000FCEE5. Which is only 1036005 bytes (~1 MB).
Why???
 
     
    