I am studying the difference between an .EXE program and a .COM program. The .EXE is logical to me that the stack is in another segment with respect to the program code (in fact a stack is forced and to indicate a limit of this with .STACK), therefore, when I go to insert values in the stack (in an .EXE), using a different segment than the program, I'm not going to confuse these two.
Example:
SP = 0400
SS = 3996 CS = 3995 IP = 0000
The stack has a capacity of 1024 Byte (400h) and refers to the stack segment 3996h, which is different from the code segment which is 3995h. So I'm sure the data doesn't get confused.
The thing I don't understand though is when I have to deal with .COM programs; because I know very well that they use only one segment and I find myself with a situation similar to this:
SP = FFEE
SS = 114A CS = 114A IP = 0100
I have the stack segment which matches the code segment. So if I keep putting values on the stack, will they end up in my code sooner or later?