Hi! I am working on a 32-bit mode program in ANSI C format using the
Digital Mars C compiler. I was unable to get the version, but it's
probably a few years old. The program is to compress strings for certain
old 8-bit computers such that a target program can print out individual strings without referring to other strings. I'm working on using tokenization, RLE of spaces (tabs of given sizes) and ways to compress literals without full-blown Huffman. The problem is that, as soon as the program starts, the computer crashes with a BSOD. :( I didn't record
the stop code. I don't even get the text that is supposed to display
upon start-up. I attached the whole main module:
I don't even get the text that is supposed to display upon start-up.
Does a "hello world" program work?
Does a "hello world" program work?
I tried one using the same settings as the problem code, and it worked.
1. Make the "main" program in the problem program the
first thing that is compiled. Currently it is the last of 3 things.
2. Put a "return 0" after the print on startup in the main
program, while leaving everything else the same.
I tried both of your suggestions. Same result.
Could it be the usage of calloc()?
Try combining both suggestions - ie put main as the first
file, and do a return 0 after the first printf.
Also send both the main.c code and the compile command
you are using so that I can see again.
Also send the working hello world - both code and compile command.
Also send both the main.c code and the compile command
you are using so that I can see again.
The problem code:
puts ("Ready to start program!"); getchar();
I asked you to put a return 0 after that puts. I don't see it.
I tried adding "return 0;" to the beginning of the program and got
the same problem, but I have more information: IIRC, it was a
system service exception, but I didn't commit the causing program
to memory. Also, I got another BSOD stating I think a DMA
exception, and, upon a second restart, the system wouldn't start
up. :( Then Windows performed auto fix mode. I have it do nothing,
and the system started behaving properly again at that point.
By "behaving properly" do you mean the problem with your
program has been solved and you no longer need help?
On Sunday, July 30, 2023 at 8:01:04 PM UTC-4, Paul Edwards wrote:
By "behaving properly" do you mean the problem with your
program has been solved and you no longer need help?
No, just that Windows started behaving properly again in the end.
I just tried your suggestions. No change. :( Following are the current main() definition:
--------------------------------
int main (int argc, char** argv)
{
char c, c2;
struct string_buffer * atstring;
//Enable the following line and declare
//char programname[128]; if the executable path is
//needed:
//strcpy (programname, argv[0]);
//Analyze the command line:
return 0;
puts ("Ready to start program!"); getchar();
c:\dm\bin\dmc main.c buffer.c in.c -o -mn -4 -optok_comp.exe
I just tried your suggestions. No change. :(
Have you tried stepping through it in the debugger?
Sysop: | Keyop |
---|---|
Location: | Huddersfield, West Yorkshire, UK |
Users: | 379 |
Nodes: | 16 (2 / 14) |
Uptime: | 42:35:09 |
Calls: | 8,141 |
Calls today: | 4 |
Files: | 13,085 |
Messages: | 5,857,851 |