2016-12-28 20:32:00 +00:00
|
|
|
// ACME - a crossassembler for producing 6502/65c02/65816/65ce02 code.
|
2024-02-18 01:11:33 +00:00
|
|
|
// Copyright (C) 1998-2024 Marco Baye
|
2012-02-27 21:14:46 +00:00
|
|
|
// Have a look at "acme.c" for further info
|
|
|
|
//
|
2014-03-11 14:22:32 +00:00
|
|
|
// CPU type stuff
|
|
|
|
#ifndef cpu_type_H
|
|
|
|
#define cpu_type_H
|
2012-02-27 21:14:46 +00:00
|
|
|
|
|
|
|
|
|
|
|
#include "config.h"
|
|
|
|
|
|
|
|
|
2024-02-18 01:11:33 +00:00
|
|
|
// types
|
|
|
|
|
2014-03-10 00:17:10 +00:00
|
|
|
struct cpu_type {
|
2012-02-27 21:14:46 +00:00
|
|
|
// This function is not allowed to change GlobalDynaBuf
|
|
|
|
// because that's where the mnemonic is stored!
|
2020-06-14 00:26:38 +00:00
|
|
|
boolean (*keyword_is_mnemonic)(int);
|
|
|
|
bits flags; // see below for bit meanings
|
|
|
|
unsigned char default_align_value;
|
2012-02-27 21:14:46 +00:00
|
|
|
};
|
2014-03-10 00:17:10 +00:00
|
|
|
#define CPUFLAG_INDIRECTJMPBUGGY (1u << 0) // warn if "jmp ($xxff)" is assembled
|
|
|
|
#define CPUFLAG_SUPPORTSLONGREGS (1u << 1) // allow "!al" and "!rl" pseudo opcodes
|
2014-11-25 23:57:15 +00:00
|
|
|
#define CPUFLAG_8B_AND_AB_NEED_0_ARG (1u << 2) // warn if "ane/lxa #$xx" uses non-zero arg
|
2016-02-16 23:11:04 +00:00
|
|
|
#define CPUFLAG_ISBIGENDIAN (1u << 3) // for 16/24/32-bit values, output msb first
|
2016-12-28 20:32:00 +00:00
|
|
|
#define CPUFLAG_DECIMALSUBTRACTBUGGY (1u << 4) // warn if "sed" is assembled
|
2020-05-31 13:07:40 +00:00
|
|
|
#define CPUFLAG_WARN_ABOUT_FF_PTR (1u << 5) // warn if MNEMO($ff) is assembled
|
2014-03-10 00:17:10 +00:00
|
|
|
|
2024-02-18 01:11:33 +00:00
|
|
|
|
|
|
|
// constants
|
|
|
|
|
|
|
|
extern const char cputype_names[]; // string to show if cputype_find() returns NULL
|
|
|
|
|
|
|
|
|
2024-02-17 16:52:32 +00:00
|
|
|
// variables
|
2024-02-18 01:11:33 +00:00
|
|
|
|
|
|
|
extern const struct cpu_type *cpu_current_type;
|
|
|
|
extern boolean cpu_a_is_long;
|
|
|
|
extern boolean cpu_xy_are_long;
|
|
|
|
|
|
|
|
|
|
|
|
// prototypes
|
2024-02-17 16:52:32 +00:00
|
|
|
|
2014-12-16 08:21:44 +00:00
|
|
|
// if cpu type and value match, set register length variable to value.
|
|
|
|
// if cpu type and value don't match, complain instead.
|
2020-05-06 11:40:06 +00:00
|
|
|
extern void vcpu_check_and_set_reg_length(boolean *var, boolean make_long);
|
2024-02-18 01:11:33 +00:00
|
|
|
|
2014-03-11 14:22:32 +00:00
|
|
|
// set default value for pass
|
2014-12-16 08:21:44 +00:00
|
|
|
extern void cputype_passinit(const struct cpu_type *cpu_type);
|
2024-02-18 01:11:33 +00:00
|
|
|
|
2014-12-04 15:31:54 +00:00
|
|
|
// lookup cpu type held in DynaBuf and return its struct pointer (or NULL on failure)
|
|
|
|
extern const struct cpu_type *cputype_find(void);
|
2012-02-27 21:14:46 +00:00
|
|
|
|
|
|
|
|
|
|
|
#endif
|