mirror of
https://github.com/cc65/cc65.git
synced 2025-01-10 19:29:45 +00:00
Temp fix for address size detection of symbols
git-svn-id: svn://svn.cc65.org/cc65/trunk@2701 b7a2c559-68d2-44c3-8de9-860c34a00d81
This commit is contained in:
parent
9ebc3d1f01
commit
3a7c054f6b
@ -46,6 +46,7 @@
|
|||||||
#include "scanner.h"
|
#include "scanner.h"
|
||||||
#include "segment.h"
|
#include "segment.h"
|
||||||
#include "spool.h"
|
#include "spool.h"
|
||||||
|
#include "studyexpr.h" /* ### */
|
||||||
#include "symentry.h"
|
#include "symentry.h"
|
||||||
#include "symtab.h"
|
#include "symtab.h"
|
||||||
|
|
||||||
@ -87,20 +88,6 @@ int IsLocalNameId (unsigned Name)
|
|||||||
|
|
||||||
|
|
||||||
|
|
||||||
static unsigned SymAddrSize (const SymEntry* S)
|
|
||||||
/* Get the default address size for a symbol. */
|
|
||||||
{
|
|
||||||
/* Local symbols are always near (is this ok?) */
|
|
||||||
if (IsLocalNameId (S->Name)) {
|
|
||||||
return ADDR_SIZE_ABS;
|
|
||||||
}
|
|
||||||
|
|
||||||
/* Return the address size of the segment */
|
|
||||||
return GetCurrentSegAddrSize ();
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
SymEntry* NewSymEntry (const char* Name)
|
SymEntry* NewSymEntry (const char* Name)
|
||||||
/* Allocate a symbol table entry, initialize and return it */
|
/* Allocate a symbol table entry, initialize and return it */
|
||||||
{
|
{
|
||||||
@ -220,20 +207,12 @@ void SymDef (SymEntry* S, ExprNode* Expr, unsigned char AddrSize, unsigned Flags
|
|||||||
|
|
||||||
/* Map a default address size to a real value */
|
/* Map a default address size to a real value */
|
||||||
if (AddrSize == ADDR_SIZE_DEFAULT) {
|
if (AddrSize == ADDR_SIZE_DEFAULT) {
|
||||||
long Val;
|
/* ### Must go! Delay address size calculation until end of assembly! */
|
||||||
if (IsConstExpr (Expr, &Val)) {
|
ExprDesc ED;
|
||||||
if (IsByteRange (Val)) {
|
ED_Init (&ED);
|
||||||
AddrSize = ADDR_SIZE_ZP;
|
StudyExpr (Expr, &ED);
|
||||||
} else if (IsWordRange (Val)) {
|
AddrSize = ED.AddrSize;
|
||||||
AddrSize = ADDR_SIZE_ABS;
|
ED_Done (&ED);
|
||||||
} else if (IsFarRange (Val)) {
|
|
||||||
AddrSize = ADDR_SIZE_FAR;
|
|
||||||
} else {
|
|
||||||
AddrSize = ADDR_SIZE_LONG;
|
|
||||||
}
|
|
||||||
} else {
|
|
||||||
AddrSize = SymAddrSize (S);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Set the symbol value */
|
/* Set the symbol value */
|
||||||
|
Loading…
x
Reference in New Issue
Block a user