Extend the object code format by adding a (currently empty) scope table.

Use the address size for import, export and debug symbols (object code
change).
More changes to support the --memory-model switch and address sizes.


git-svn-id: svn://svn.cc65.org/cc65/trunk@2691 b7a2c559-68d2-44c3-8de9-860c34a00d81
This commit is contained in:
cuz
2003-11-28 22:12:14 +00:00
parent e3eea961c2
commit 8f9a21ae3f
35 changed files with 589 additions and 254 deletions

View File

@@ -36,6 +36,7 @@
#include <string.h>
/* common */
#include "addrsize.h"
#include "mmodel.h"
@@ -56,6 +57,11 @@ static const char* MemoryModelNames[MMODEL_COUNT] = {
"huge",
};
/* Address sizes for the segments */
unsigned char CodeAddrSize = ADDR_SIZE_ABS;
unsigned char DataAddrSize = ADDR_SIZE_ABS;
unsigned char ZpAddrSize = ADDR_SIZE_ZP;
/*****************************************************************************/
@@ -82,3 +88,41 @@ mmodel_t FindMemoryModel (const char* Name)
void SetMemoryModel (mmodel_t Model)
/* Set the memory model updating the MemoryModel variables and the address
* sizes for the segments.
*/
{
/* Remember the memory model */
MemoryModel = Model;
/* Set the address sizes for the segments */
switch (MemoryModel) {
case MMODEL_NEAR:
/* Code: near, data: near */
CodeAddrSize = ADDR_SIZE_ABS;
DataAddrSize = ADDR_SIZE_ABS;
break;
case MMODEL_FAR:
/* Code: far, data: near */
CodeAddrSize = ADDR_SIZE_FAR;
DataAddrSize = ADDR_SIZE_ABS;
break;
case MMODEL_HUGE:
/* Code: far, data: far */
CodeAddrSize = ADDR_SIZE_FAR;
DataAddrSize = ADDR_SIZE_FAR;
break;
default:
break;
}
/* Zeropage is always zeropage */
ZpAddrSize = ADDR_SIZE_ZP;
}