DSPRelated.com
Forums

FATAL_SYM1 on loading C3X.DSK

Started by baghli June 7, 2004
Hi

if(Init_Communication(10000) == NO_ERR) break;
dosn't go out,
I copied C3X.DSK in the directory, so it find the file (I had to
guess it :-(

I get into it
and after some amount of time debugging, it sounds like in

MSGS read_syms(char *filename)
when it reads the first symbol,
the :
MSGS xref_add(char *ptr, ulong value, NUM_TYPE type, SYM_TYPE Stype)

the
if(symbol_ptr==NULL) return FATAL_SYM1;

returns the error why my symbol_ptr is null ?

the
//=================================================
// Symbol_Clear() clears previously loaded symbols
// by changing the last_ref symbol counter.
//=================================================
void DLLEXTEND Symbol_Clear(int level)

fixed 2 times to NULL ???

Am I missing something (still in 2.02) version ?

DSK3D.EXe and windows version works well, so I am sure the
communication is ok Thanks for your help
I know I am disturbing u, but tou are the only person on earth, that
can help since you are the author :-)

if there is a Howto file, please let me know

Sincereley
Lotfi




Hello Lotfi

I am 90% sure that the symbol table memory has not been initialized.  At the top of each WinMain() or main() you will find the function 'Create_SYM()' which is responsible for malloc'ing a chunk of system memory that the symbols will later be stored into.  Without it your code will definitely fail as you describe.  The history of this function is that as the example codes got bigger, more storage was needed for the symbols, eventually getting so large that they would not fit in a statically declared array.

You may want to note here that the array is limited to 10K bytes of string storage and 1000 unique symbols (average of 10 bytes per symbol), but that the comment says to bump this up to 3K/30K.  Another small oops on my part as no-one seems to bump into the 1K/10K limit.  If you think about it this is a pretty big pile of symbols as it is equivalent to having 1K lines of ASM code each with a unique symbol!  But if you ever do need more, this is where to add.

Above this will be the function 'PRELOAD_DSK3DLL();'  This function is not required for all Windows compilers, but for some Win32 compilers it was/is.  This is a dummy call into the DLL that forces the DLL to load.  This in turn makes the data in the DLL accessible.  Without it other strange things can happen.

PRELOAD_DSK3DLL(); // Force DLL into memory
Create_SYM();      // Initialize symbol storage

You also are correct that this is missing in the documentation (other than by plodding through the examples).

I also saw in your other post that '2.04' was referenced someplace in the latest code install.  Im not quite sure where that is, but a number of manual entries are made during the build of the install file.  Quite possibly I missed one.

Hope this helps,
Best regards
Keith Larson

http://home.comcast.net/~klarsondsp/
baghli wrote:
Hi

if(Init_Communication(10000) == NO_ERR) break;
dosn't go out,
I copied C3X.DSK in the directory, so it find the file (I had to
guess it :-(

I get into it and after some amount of time debugging, it sounds like in

MSGS read_syms(char *filename)
when it reads the first symbol,
the :
MSGS xref_add(char *ptr, ulong value, NUM_TYPE type, SYM_TYPE Stype)

the
  if(symbol_ptr==NULL) return FATAL_SYM1;

returns the error why my symbol_ptr is null ?

the
//=================================================
// Symbol_Clear() clears previously loaded symbols
// by changing the last_ref symbol counter.
//=================================================
void DLLEXTEND Symbol_Clear(int level)

fixed 2 times to NULL ???

Am I missing something (still in 2.02) version ?

DSK3D.EXe and windows version works well, so I am sure the
communication is ok Thanks for your help
I know I am disturbing u, but tou are the only person on earth, that
can help since you are the author :-)

if there is a Howto file, please let me know

Sincereley
Lotfi