allowed # characters in MVP/MVN syntax

git-svn-id: https://svn.code.sf.net/p/acme-crossass/code-0/trunk@261 4df02467-bbd4-4a76-a152-e7ce94205b78
This commit is contained in:
marcobaye 2020-06-26 10:45:20 +00:00
parent 296ecefa6c
commit c85081cbe4
2 changed files with 29 additions and 12 deletions

View File

@ -1048,26 +1048,43 @@ static void group_relative16(int opcode, int preoffset)
}
// "mvn" and "mvp"
// TODO - allow alternative syntax with '#' and 24-bit addresses (select via CLI switch)
// TODO - allow alternative syntax with 24-bit addresses (select via CLI switch)?
static void group_mvn_mvp(int opcode)
{
boolean unmatched_hash = FALSE;
struct number source,
target;
// assembler syntax: "mnemonic source, target"
// assembler syntax: "mnemonic source, target" or "mnemonic #source, #target"
// machine language order: "opcode target source"
SKIPSPACE();
// get first arg
if (GotByte == '#') {
GetByte(); // eat char
unmatched_hash = !unmatched_hash;
}
get_int_arg(&source, TRUE);
typesystem_want_nonaddr(&source);
if (Input_accept_comma()) {
get_int_arg(&target, TRUE);
typesystem_want_nonaddr(&target);
// machine language order: "opcode target source"
Output_byte(opcode);
output_8(target.val.intval);
output_8(source.val.intval);
Input_ensure_EOS();
} else {
// get comma
if (!Input_accept_comma()) {
Throw_error(exception_syntax);
return;
}
// get second arg
if (GotByte == '#') {
GetByte(); // eat char
unmatched_hash = !unmatched_hash;
}
get_int_arg(&target, TRUE);
typesystem_want_nonaddr(&target);
// output
Output_byte(opcode);
output_8(target.val.intval);
output_8(source.val.intval);
// sanity check
if (unmatched_hash)
Throw_error(exception_syntax);
Input_ensure_EOS();
}
// "rmb0..7" and "smb0..7"

View File

@ -9,7 +9,7 @@
#define RELEASE "0.96.5" // update before release FIXME
#define CODENAME "Fenchurch" // update before release
#define CHANGE_DATE "23 June" // update before release FIXME
#define CHANGE_DATE "26 June" // update before release FIXME
#define CHANGE_YEAR "2020" // update before release
//#define HOME_PAGE "http://home.pages.de/~mac_bacon/smorbrod/acme/"
#define HOME_PAGE "http://sourceforge.net/p/acme-crossass/" // FIXME