1
0
mirror of https://github.com/cc65/cc65.git synced 2025-02-26 23:30:03 +00:00

Add new o65 operating system

git-svn-id: svn://svn.cc65.org/cc65/trunk@1253 b7a2c559-68d2-44c3-8de9-860c34a00d81
This commit is contained in:
cuz 2002-04-21 14:30:40 +00:00
parent 0e4eef1f0f
commit 1c3e74a148
4 changed files with 29 additions and 17 deletions

View File

@ -802,18 +802,19 @@ static void ParseO65 (void)
/* Parse the o65 format section */
{
static const IdentTok Attributes [] = {
{ "EXPORT", CFGTOK_EXPORT },
{ "IMPORT", CFGTOK_IMPORT },
{ "TYPE", CFGTOK_TYPE },
{ "OS", CFGTOK_OS },
{ "EXPORT", CFGTOK_EXPORT },
{ "IMPORT", CFGTOK_IMPORT },
{ "TYPE", CFGTOK_TYPE },
{ "OS", CFGTOK_OS },
};
static const IdentTok Types [] = {
{ "SMALL", CFGTOK_SMALL },
{ "LARGE", CFGTOK_LARGE },
{ "SMALL", CFGTOK_SMALL },
{ "LARGE", CFGTOK_LARGE },
};
static const IdentTok OperatingSystems [] = {
{ "LUNIX", CFGTOK_LUNIX },
{ "OSA65", CFGTOK_OSA65 },
{ "LUNIX", CFGTOK_LUNIX },
{ "OSA65", CFGTOK_OSA65 },
{ "CC65", CFGTOK_CC65 },
};
while (CfgTok == CFGTOK_IDENT) {
@ -878,7 +879,7 @@ static void ParseO65 (void)
break;
case CFGTOK_LARGE:
O65SetLargeModel (O65FmtDesc);
O65SetLargeModel (O65FmtDesc);
break;
default:
@ -894,12 +895,16 @@ static void ParseO65 (void)
switch (CfgTok) {
case CFGTOK_LUNIX:
O65SetOS (O65FmtDesc, O65OS_LUNIX);
break;
O65SetOS (O65FmtDesc, O65OS_LUNIX);
break;
case CFGTOK_OSA65:
O65SetOS (O65FmtDesc, O65OS_OSA65);
break;
O65SetOS (O65FmtDesc, O65OS_OSA65);
break;
case CFGTOK_CC65:
O65SetOS (O65FmtDesc, O65OS_CC65);
break;
default:
CfgError ("Unexpected OS token");

View File

@ -90,9 +90,9 @@
#define O65RELOC_WORD 0x80
#define O65RELOC_HIGH 0x40
#define O65RELOC_LOW 0x20
#define O65RELOC_SEGADR 0xc0
#define O65RELOC_SEG 0xa0
#define O65RELOC_MASK 0xc0
#define O65RELOC_SEGADR 0xC0
#define O65RELOC_SEG 0xA0
#define O65RELOC_MASK 0xE0
/* O65 executable file header */
typedef struct O65Header O65Header;
@ -1013,6 +1013,7 @@ void O65SetOS (O65Desc* D, unsigned OS)
{
static const unsigned char OSA65 [2] = { O65OS_OSA65, 0 };
static const unsigned char Lunix [2] = { O65OS_LUNIX, 0 };
static const unsigned char CC65 [4] = { O65OS_CC65, 0, 0, 0 };
/* Write the correct option */
switch (OS) {
@ -1025,6 +1026,10 @@ void O65SetOS (O65Desc* D, unsigned OS)
O65SetOption (D, O65OPT_OS, Lunix, sizeof (Lunix));
break;
case O65OS_CC65:
O65SetOption (D, O65OPT_OS, CC65, sizeof (CC65));
break;
default:
Internal ("Trying to set invalid O65 operating system: %u", OS);

View File

@ -64,6 +64,7 @@ typedef struct O65Desc O65Desc;
/* Operating system codes for O65OPT_OS */
#define O65OS_OSA65 1
#define O65OS_LUNIX 2
#define O65OS_CC65 3
@ -82,7 +83,7 @@ void FreeO65Desc (O65Desc* D);
void O65Set6502 (O65Desc* D);
/* Enable 6502 mode */
void O65Set65816 (O65Desc* D);
void O65Set65816 (O65Desc* D);
/* Enable 816 mode */
void O65SetSmallModel (O65Desc* D);

View File

@ -101,6 +101,7 @@ typedef enum {
CFGTOK_LUNIX,
CFGTOK_OSA65,
CFGTOK_CC65,
CFGTOK_CONDES,
CFGTOK_SEGMENT,