Closed ecm-pushbx closed 4 years ago
Hello @ecm-pushbx,
On second thought, you are right.
I think a .com
file linked with newlib-ia16
will probably work even with less than 64 KiB of memory. But the startup code should at least check that there is enough space for BSS and the stack. I will fix this.
Thank you!
The following code is used by the (default) CRT startup code when building using ia16-elf-gcc:
https://github.com/tkchia/newlib-ia16/blob/1c38cec61638e54f961731bf28615a91f16454d7/libgloss/ia16/dos-models-crt0.S#L27
I think this should check for errors and abort if so. It is allowed for DOS to allocate less than 64 KiB to the process. (This is unlikely to occur. But with LOADHIGH it is more likely.)