acme/src/cpu.h
marcobaye 7a4237eb3c fixed two bugs, added test files, did cleanup
bug 1: in some cases "--format" could not override "!to"
bug 2: "cannot open output file" resulted in "success" exit code


git-svn-id: https://svn.code.sf.net/p/acme-crossass/code-0/trunk@340 4df02467-bbd4-4a76-a152-e7ce94205b78
2024-02-18 01:11:33 +00:00

56 lines
1.6 KiB
C

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