Hi Yves!
Perhaps there is another way but is working.
struct asym *CreateVariable( const char *name, int value )
/********************************************************/
{
struct asym *sym;
DebugMsg1(( "CreateVariable(%s, %d ) enter\n", name, value ));
sym = SymSearch( name );
if( sym == NULL ) {
sym = SymCreate( name );
#if FASTPASS
sym->issaved = FALSE;
//sym->issaved = StoreState; /* v2.10 */
#endif
} else if ( sym->state == SYM_UNDEFINED ) {
sym->value3264 = 0; /* v2.13: added qWord indication H E R E */
//sym->uvalue = 0;
sym_remove_table( &SymTables[TAB_UNDEF], (struct dsym *)sym );
sym->fwdref = TRUE;
#if FASTPASS
sym->issaved = StoreState; /* v2.10 */
#endif
} else {
sym->value3264 = 0; /* v2.13: added qWord indication H E R E */
if ( sym->isequate == FALSE ) {
EmitErr( SYMBOL_REDEFINITION, name );
return( NULL );
}
#if FASTPASS
/*
* v2.09: don't save variable when it is defined the first time
* v2.10: store state only when variable is changed and has been
* defined BEFORE SaveState() has been called.
*/
//if ( StoreState && sym->issaved == FALSE && sym->isdefined == TRUE ) {
if ( StoreState && sym->issaved == FALSE ) {
SaveVariableState( sym );
}
#endif
}
sym->isdefined = TRUE;
sym->state = SYM_INTERNAL;
//sym->mem_type = MT_ABS;
sym->variable = TRUE;
sym->value = value;
//sym->uvalue = 0;
sym->isequate = TRUE;
return( sym );
}
/*
* CreateConstant()
* this is the worker behind EQU.
* EQU may define 3 different types of equates:
* - numeric constants (with or without "type")
* - relocatable items ( aliases )
* - text macros
* the argument may be
* - an expression which can be evaluated to a number or address
* - a text literal (enclosed in <>)
* - anything. This will also become a text literal.
*/