mirror of
https://github.com/uffejakobsen/acme.git
synced 2024-06-01 13:41:29 +00:00
d152f60acd
git-svn-id: https://svn.code.sf.net/p/acme-crossass/code-0/trunk@34 4df02467-bbd4-4a76-a152-e7ce94205b78
54 lines
1.1 KiB
C
54 lines
1.1 KiB
C
// ACME - a crossassembler for producing 6502/65c02/65816 code.
|
|
// Copyright (C) 1998-2014 Marco Baye
|
|
// Have a look at "acme.c" for further info
|
|
//
|
|
// Type system stuff
|
|
#include "typesystem.h"
|
|
#include "config.h"
|
|
#include "alu.h"
|
|
#include "global.h"
|
|
|
|
|
|
static int in_address_block = FALSE;
|
|
static int in_address_statement = FALSE;
|
|
|
|
// Functions
|
|
|
|
int typesystem_says_address(void)
|
|
{
|
|
return in_address_block | in_address_statement;
|
|
}
|
|
|
|
void typesystem_force_address_block(void)
|
|
{
|
|
int buffer = in_address_block;
|
|
|
|
in_address_block = TRUE;
|
|
Parse_optional_block();
|
|
in_address_block = buffer;
|
|
}
|
|
|
|
void typesystem_force_address_statement(int value)
|
|
{
|
|
in_address_statement = value;
|
|
}
|
|
|
|
void typesystem_want_imm(struct result_t *result)
|
|
{
|
|
if (!warn_on_type_mismatch)
|
|
return;
|
|
if (!(result->flags & MVALUE_DEFINED))
|
|
return;
|
|
if (result->addr_refs != 0)
|
|
Throw_warning("Wrong type - expected integer.");
|
|
}
|
|
void typesystem_want_addr(struct result_t *result)
|
|
{
|
|
if (!warn_on_type_mismatch)
|
|
return;
|
|
if (!(result->flags & MVALUE_DEFINED))
|
|
return;
|
|
if (result->addr_refs != 1)
|
|
Throw_warning("Wrong type - expected address.");
|
|
}
|