mirror of
https://github.com/uffejakobsen/acme.git
synced 2025-02-07 06:31:03 +00:00
renamed fn and moved between files, no change in functionality
git-svn-id: https://svn.code.sf.net/p/acme-crossass/code-0/trunk@384 4df02467-bbd4-4a76-a152-e7ce94205b78
This commit is contained in:
parent
fb9bbc7c56
commit
e88aeab14c
25
src/global.c
25
src/global.c
@ -262,7 +262,7 @@ static void parse_symbol_definition(scope_t scope)
|
||||
if (GotByte == '?')
|
||||
symbol_fix_dynamic_name();
|
||||
|
||||
force_bit = input_get_force_bit(); // skips spaces after (yes, force bit is allowed for label definitions)
|
||||
force_bit = parser_get_force_bit(); // skips spaces after (yes, force bit is allowed for label definitions)
|
||||
if (GotByte == '=') {
|
||||
// explicit symbol definition (symbol = <something>)
|
||||
GetByte(); // eat '='
|
||||
@ -457,6 +457,29 @@ void parse_and_close_platform_file(FILE *fd, const char *eternal_plat_filename)
|
||||
inputchange_back(&icb);
|
||||
}
|
||||
|
||||
// read optional info about parameter length
|
||||
bits parser_get_force_bit(void)
|
||||
{
|
||||
char byte;
|
||||
bits force_bit = 0;
|
||||
|
||||
if (GotByte == '+') {
|
||||
byte = GetByte();
|
||||
if (byte == '1')
|
||||
force_bit = NUMBER_FORCES_8;
|
||||
else if (byte == '2')
|
||||
force_bit = NUMBER_FORCES_16;
|
||||
else if (byte == '3')
|
||||
force_bit = NUMBER_FORCES_24;
|
||||
if (force_bit)
|
||||
GetByte();
|
||||
else
|
||||
Throw_error("Illegal postfix.");
|
||||
}
|
||||
SKIPSPACE();
|
||||
return force_bit;
|
||||
}
|
||||
|
||||
|
||||
// Error handling
|
||||
|
||||
|
@ -197,6 +197,9 @@ extern int parse_optional_block(void);
|
||||
// and the pointer must remain valid forever!
|
||||
extern void parse_and_close_platform_file(FILE *fd, const char *eternal_plat_filename);
|
||||
|
||||
// read optional info about parameter length
|
||||
extern bits parser_get_force_bit(void);
|
||||
|
||||
// generate a debug/info/warning/error message
|
||||
extern void throw_message(enum debuglevel level, const char msg[]);
|
||||
|
||||
|
24
src/input.c
24
src/input.c
@ -732,30 +732,6 @@ int input_expect(int chr)
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
// read optional info about parameter length
|
||||
// FIXME - move to different file!
|
||||
bits input_get_force_bit(void)
|
||||
{
|
||||
char byte;
|
||||
bits force_bit = 0;
|
||||
|
||||
if (GotByte == '+') {
|
||||
byte = GetByte();
|
||||
if (byte == '1')
|
||||
force_bit = NUMBER_FORCES_8;
|
||||
else if (byte == '2')
|
||||
force_bit = NUMBER_FORCES_16;
|
||||
else if (byte == '3')
|
||||
force_bit = NUMBER_FORCES_24;
|
||||
if (force_bit)
|
||||
GetByte();
|
||||
else
|
||||
Throw_error("Illegal postfix.");
|
||||
}
|
||||
SKIPSPACE();
|
||||
return force_bit;
|
||||
}
|
||||
|
||||
// force input system to return "end of file" on next read
|
||||
// (back end function for "!eof" pseudo opcode)
|
||||
void input_force_eof(void)
|
||||
|
@ -141,10 +141,6 @@ extern int input_accept_comma(void);
|
||||
// If not found, throw syntax error and return FALSE.
|
||||
extern int input_expect(int chr);
|
||||
|
||||
// read optional info about parameter length
|
||||
// FIXME - move to different file!
|
||||
extern bits input_get_force_bit(void);
|
||||
|
||||
// force input system to return "end of file" on next read
|
||||
// (back end function for "!eof" pseudo opcode)
|
||||
extern void input_force_eof(void);
|
||||
|
20
src/mnemo.c
20
src/mnemo.c
@ -773,7 +773,7 @@ static bits calc_arg_size(bits force_bit, struct number *argument, bits addressi
|
||||
// Mnemonics using only implied addressing.
|
||||
static void group_only_implied_addressing(int opcode)
|
||||
{
|
||||
//bits force_bit = input_get_force_bit(); // skips spaces after // TODO - accept postfix and complain about it?
|
||||
//bits force_bit = parser_get_force_bit(); // skips spaces after // TODO - accept postfix and complain about it?
|
||||
// TODO - accept argument and complain about it? error message should tell more than "garbage data at end of line"!
|
||||
// for 65ce02 and 4502, warn about buggy decimal mode
|
||||
if ((opcode == 0xf8) && (cpu_current_type->flags & CPUFLAG_DECIMALSUBTRACTBUGGY)) {
|
||||
@ -926,7 +926,7 @@ static void group_main(int index, bits flags)
|
||||
{
|
||||
unsigned long immediate_opcodes;
|
||||
struct number result;
|
||||
bits force_bit = input_get_force_bit(); // skips spaces after
|
||||
bits force_bit = parser_get_force_bit(); // skips spaces after
|
||||
|
||||
switch (get_addr_mode(&result)) {
|
||||
case IMMEDIATE_ADDRESSING: // #$ff or #$ffff (depending on accu length)
|
||||
@ -990,7 +990,7 @@ static void group_misc(int index, bits immediate_mode)
|
||||
{
|
||||
unsigned long immediate_opcodes;
|
||||
struct number result;
|
||||
bits force_bit = input_get_force_bit(); // skips spaces after
|
||||
bits force_bit = parser_get_force_bit(); // skips spaces after
|
||||
|
||||
switch (get_addr_mode(&result)) {
|
||||
case IMPLIED_ADDRESSING: // implied addressing
|
||||
@ -1031,7 +1031,7 @@ static void group_misc(int index, bits immediate_mode)
|
||||
// mnemonics using only 8bit relative addressing (short branch instructions).
|
||||
static void group_std_branches(int opcode)
|
||||
{
|
||||
//bits force_bit = input_get_force_bit(); // skips spaces after // TODO - accept postfix and complain about it?
|
||||
//bits force_bit = parser_get_force_bit(); // skips spaces after // TODO - accept postfix and complain about it?
|
||||
output_byte(opcode);
|
||||
near_branch(2);
|
||||
}
|
||||
@ -1040,7 +1040,7 @@ static void group_std_branches(int opcode)
|
||||
static void group_bbr_bbs(int opcode)
|
||||
{
|
||||
struct number zpmem;
|
||||
//bits force_bit = input_get_force_bit(); // skips spaces after // TODO - accept postfix and complain about it?
|
||||
//bits force_bit = parser_get_force_bit(); // skips spaces after // TODO - accept postfix and complain about it?
|
||||
|
||||
get_int_arg(&zpmem, TRUE);
|
||||
typesystem_want_addr(&zpmem);
|
||||
@ -1054,7 +1054,7 @@ static void group_bbr_bbs(int opcode)
|
||||
// mnemonics using only 16bit relative addressing (BRL and PER of 65816, and the long branches of 65ce02)
|
||||
static void group_relative16(int opcode, int preoffset)
|
||||
{
|
||||
//bits force_bit = input_get_force_bit(); // skips spaces after // TODO - accept postfix and complain about it?
|
||||
//bits force_bit = parser_get_force_bit(); // skips spaces after // TODO - accept postfix and complain about it?
|
||||
output_byte(opcode);
|
||||
far_branch(preoffset);
|
||||
}
|
||||
@ -1066,7 +1066,7 @@ static void group_mvn_mvp(int opcode)
|
||||
boolean unmatched_hash = FALSE;
|
||||
struct number source,
|
||||
target;
|
||||
//bits force_bit = input_get_force_bit(); // skips spaces after // TODO - accept postfix and complain about it?
|
||||
//bits force_bit = parser_get_force_bit(); // skips spaces after // TODO - accept postfix and complain about it?
|
||||
|
||||
// assembler syntax: "mnemonic source, target" or "mnemonic #source, #target"
|
||||
// machine language order: "opcode target source"
|
||||
@ -1103,7 +1103,7 @@ static void group_mvn_mvp(int opcode)
|
||||
// "rmb0..7" and "smb0..7"
|
||||
static void group_only_zp(int opcode)
|
||||
{
|
||||
//bits force_bit = input_get_force_bit(); // skips spaces after // TODO - accept postfix and complain about it?
|
||||
//bits force_bit = parser_get_force_bit(); // skips spaces after // TODO - accept postfix and complain about it?
|
||||
struct number target;
|
||||
|
||||
get_int_arg(&target, TRUE);
|
||||
@ -1116,7 +1116,7 @@ static void group_only_zp(int opcode)
|
||||
// NOP on m65 cpu (FIXME - "!align" outputs NOPs, what about that? what if user writes NEG:NEG?)
|
||||
static void group_prefix(int opcode)
|
||||
{
|
||||
//bits force_bit = input_get_force_bit(); // skips spaces after // TODO - accept postfix and complain about it?
|
||||
//bits force_bit = parser_get_force_bit(); // skips spaces after // TODO - accept postfix and complain about it?
|
||||
char buffer[100]; // 640K should be enough for anybody
|
||||
|
||||
sprintf(buffer, "The chosen CPU uses opcode 0x%02x as a prefix code, do not use this mnemonic!", opcode);
|
||||
@ -1127,7 +1127,7 @@ static void group_prefix(int opcode)
|
||||
static void group_jump(int index)
|
||||
{
|
||||
struct number result;
|
||||
bits force_bit = input_get_force_bit(); // skips spaces after
|
||||
bits force_bit = parser_get_force_bit(); // skips spaces after
|
||||
|
||||
switch (get_addr_mode(&result)) {
|
||||
case ABSOLUTE_ADDRESSING: // absolute16 or absolute24
|
||||
|
@ -826,7 +826,7 @@ static enum eos po_set(void) // now GotByte = illegal char
|
||||
if (input_read_scope_and_symbol_name(&scope)) // skips spaces before
|
||||
return SKIP_REMAINDER; // zero length
|
||||
|
||||
force_bit = input_get_force_bit(); // skips spaces after
|
||||
force_bit = parser_get_force_bit(); // skips spaces after
|
||||
if (!input_expect('='))
|
||||
return SKIP_REMAINDER;
|
||||
|
||||
@ -1058,7 +1058,7 @@ static enum eos po_for(void) // now GotByte = illegal char
|
||||
return SKIP_REMAINDER; // zero length
|
||||
|
||||
// now GotByte = illegal char
|
||||
force_bit = input_get_force_bit(); // skips spaces after
|
||||
force_bit = parser_get_force_bit(); // skips spaces after
|
||||
loop.symbol = symbol_find(scope); // if not number, error will be reported on first assignment
|
||||
if (input_accept_comma()) {
|
||||
// counter syntax (old or new)
|
||||
|
@ -9,7 +9,7 @@
|
||||
|
||||
#define RELEASE "0.97" // update before release FIXME
|
||||
#define CODENAME "Zem" // update before release
|
||||
#define CHANGE_DATE "20 Jul" // update before release FIXME
|
||||
#define CHANGE_DATE "21 Jul" // update before release FIXME
|
||||
#define CHANGE_YEAR "2024" // update before release
|
||||
//#define HOME_PAGE "http://home.pages.de/~mac_bacon/smorbrod/acme/"
|
||||
#define HOME_PAGE "http://sourceforge.net/p/acme-crossass/" // FIXME
|
||||
|
Loading…
x
Reference in New Issue
Block a user