Be careful when making a .COM program (as opposed to .EXE). The CS, DS, and SS segment registers all point to the same area of memory, so if you use too much stack space, it will eventually start to trample your code. The stack pointer is initially at the top of the code segment (64KB). For example: if you have 10K of code and data, the maximum stack space available is 54KB.
Tip: when posting a question like this, please tell us what you are doing. Are you using it for Visual C++? DJGPP? DOS COM file? Are you going to link it? With what?
Doug Gale