I've been playing with submit.com and noticed stat, fopen, etc. causes the next line of submit to fail. In this case it's just calling the same com file over and over. Without submit it works fine, so it's something in how the program is exiting when run from submit?
I'm running this on a C128. but I'll try MyZ80 next. I built z88dk from source a couple weeks ago.
Simple test case: https://github.com/sgjava/c3lz/blob/mai ... baseline.c
Submit file: https://github.com/sgjava/c3lz/blob/mai ... s/test.sub
Built with https://github.com/sgjava/c3lz/blob/a88 ... ild.sh#L30
Error on screen:
B>TEST
B>BASELINE
1024 BYTED READ
B>BASELINE
CP/M ERROR ON .: INVALID DRIVE
B>BASELINE
CP/M ERROR ON .: INVALID DRIVE
B>
Any type of file IO causes errors with submit.com
Re: Any type of file IO causes errors with submit.com
For archive purposes this one is now fixed.
The issue was that we didn't bother to set sp on entry to the program. On CP/M 2.2 this is okay, since sp floats somewhere below the bdos address.
However on CP/M 3, sp on entry is some temporary workspace in high memory, so we end up overwriting bits of CP/M with the result that no future command actually works.
The fix is to do ld sp,(6) so do set sp to the address of bdos initially. This is now performed by the crt, but if you're not tracking nightly, this can be achieved with -pragma-define:REGISTER_SP=-6 as a link time option.
The issue was that we didn't bother to set sp on entry to the program. On CP/M 2.2 this is okay, since sp floats somewhere below the bdos address.
However on CP/M 3, sp on entry is some temporary workspace in high memory, so we end up overwriting bits of CP/M with the result that no future command actually works.
The fix is to do ld sp,(6) so do set sp to the address of bdos initially. This is now performed by the crt, but if you're not tracking nightly, this can be achieved with -pragma-define:REGISTER_SP=-6 as a link time option.
Re: Any type of file IO causes errors with submit.com
"..it is always the stack". 