Reputation: 675
I read that the com file contains the instructions only, so how OS knows the size of program and variables from COM file before loading it? Also how CPU identify the variables?
Upvotes: 0
Views: 56
Reputation: 28921
In the case of MSDOS, it doesn't know the size, so it allocates all of the available memory for the .COM program. If the .COM program is going to terminate and stay resident, it can release the memory that it doesn't need before exiting.
Upvotes: 4