From 70b9ee222de2626ae0346553d340b36c176f004f Mon Sep 17 00:00:00 2001 From: marcobaye Date: Tue, 30 Jun 2020 09:24:30 +0000 Subject: [PATCH] tweaked docs and removed some comments, no change in functionality git-svn-id: https://svn.code.sf.net/p/acme-crossass/code-0/trunk@273 4df02467-bbd4-4a76-a152-e7ce94205b78 --- docs/Errors.txt | 22 ++++++++++++++++++++++ docs/cputypes/all.txt | 2 +- docs/cputypes/cpu m65.txt | 8 ++++---- src/flow.c | 2 +- src/global.c | 4 ++-- src/input.c | 8 ++++---- src/mnemo.c | 2 +- 7 files changed, 35 insertions(+), 13 deletions(-) diff --git a/docs/Errors.txt b/docs/Errors.txt index abca448..e7a1d4a 100644 --- a/docs/Errors.txt +++ b/docs/Errors.txt @@ -358,6 +358,11 @@ Target out of range (N; M too far). difference to the limit - so if you succeed in optimizing M bytes away, the code would assemble. +The chosen CPU uses opcode 0xXY as a prefix code, do not use this mnemonic! + The mnemonic is valid, but should not be used on this CPU. If you + know better, you can get around this error like this: + !cpu ANY_OTHER_CPU { PROBLEMATIC_MNEMONIC } + There's more than one character. You used a text string containing more than one character in a situation where only a string with length one is allowed. @@ -404,6 +409,13 @@ Unknown pseudo opcode. Unknown "*=" segment modifier. You used a modifier keyword ACME does not know. +Unsupported backslash sequence. + The character following the backslash was not one of the allowed + ones. Backslash escaping was added in release 0.97 of ACME. + If you want to assemble an old source code without first updating + it, you can use the "--dialect" CLI switch to make ACME mimic an + older version. + Unterminated index spec. An index was started with '[' but did not end with ']'. @@ -533,9 +545,15 @@ IllegalImmediateMode The mnemonic tree contains invalid info about the size of immediate arguments. +IllegalInputSource + Input is taken neither from a file nor from a RAM block. + IllegalNumberTypeX A number was neither INT nor FLOAT nor UNDEFINED. +IllegalObjectType + A symbol is used that is neither number nor list nor string. + IllegalOperatorId IllegalOperatorGroup The expression parser found an operator that does not exist. @@ -547,6 +565,7 @@ NotEnoughArgs There was not enough data for a dyadic operator to work on. NullTypeObject +ObjectHasNullType A symbol is used that does not have a type (number/list/string) associated with it. @@ -558,6 +577,9 @@ OperatorStackNotEmpty The expression parser has finished though there are still operators left to process. +PartialEscapeSequence + Buffered data ended on a backslash, which shouldn't be possible. + SecondArgIsNotAnInt A sanity check failed: An argument should have been converted to integer but wasn't. diff --git a/docs/cputypes/all.txt b/docs/cputypes/all.txt index ea00e33..b9c48ce 100644 --- a/docs/cputypes/all.txt +++ b/docs/cputypes/all.txt @@ -187,7 +187,7 @@ quad mode introduces several new mnemonics: The new mnemonics support all the addressing modes of the original mnemonics with two exceptions: - there are no 32-bit immediate arguments - - indirect-z addressing becomes indirect addressing + - indirect-Z-indexed addressing becomes indirect addressing CAUTION: The STQ instruction clobbers the N and Z flags! There is no "real" Q register, instead A/X/Y/Z are combined to form the Q register (A holds lsb, Z holds msb), except for read-modify- diff --git a/docs/cputypes/cpu m65.txt b/docs/cputypes/cpu m65.txt index 0993d06..5c49b01 100644 --- a/docs/cputypes/cpu m65.txt +++ b/docs/cputypes/cpu m65.txt @@ -7,11 +7,11 @@ file), so this file only contains information about the extensions. "quad mode" allows 32-bit data operations using a virtual register called 'Q'. -The mnemonics aslq/lsrq/rolq/rorq/inq/deq have five addressing modes in quad -mode. -The mnemonics ldq/stq have nine addressing modes in quad mode. +The mnemonics aslq/lsrq/rolq/rorq/inq/deq have five addressing modes. +The mnemonics ldq/stq have nine addressing modes in quad mode, and a tenth +when combined with long mode. The mnemonics cpq/adcq/sbcq/andq/eorq/orq have eight addressing modes in quad -mode. +mode, and a ninth when combined with long mode. This mode is entered after a NEG:NEG (42 42) prefix, the following opcode is then taken from this table: diff --git a/src/flow.c b/src/flow.c index 5016c6c..d4f3488 100644 --- a/src/flow.c +++ b/src/flow.c @@ -46,7 +46,7 @@ boolean check_ifdef_condition(void) symbol = (struct symbol *) node->body; symbol->has_been_read = TRUE; // we did not really read the symbol's value, but checking for its existence still counts as "used it" if (symbol->object.type == NULL) - Bug_found("ObjectHasNullType", 0); // FIXME - add to docs! + Bug_found("ObjectHasNullType", 0); return symbol->object.type->is_defined(&symbol->object); } diff --git a/src/global.c b/src/global.c index e678f95..a59f834 100644 --- a/src/global.c +++ b/src/global.c @@ -491,7 +491,7 @@ void output_object(struct object *object, struct iter_context *iter) else if (object->u.number.ntype == NUMTYPE_FLOAT) iter->fn(object->u.number.val.fpval); else - Bug_found("IllegalNumberType7", object->u.number.ntype); // FIXME - add to docs! + Bug_found("IllegalNumberType0", object->u.number.ntype); } else if (object->type == &type_list) { // iterate over list item = object->u.listhead->next; @@ -512,7 +512,7 @@ void output_object(struct object *object, struct iter_context *iter) Throw_error("There's more than one character."); // see alu.c for the original of this error } } else { - Bug_found("IllegalObjectType9", 0); // FIXME - add to docs! + Bug_found("IllegalObjectType", 0); } } diff --git a/src/input.c b/src/input.c index 0c56122..98ec4c2 100644 --- a/src/input.c +++ b/src/input.c @@ -278,7 +278,7 @@ char GetByte(void) GotByte = get_processed_from_file(); break; default: - Bug_found("InvalidInputSrc", Input_now->source); // FIXME - add to docs + Bug_found("IllegalInputSrc", Input_now->source); } // // if start-of-line was read, increment line counter and repeat // if (GotByte != CHAR_SOL) @@ -329,7 +329,7 @@ static char GetQuotedByte(void) } break; default: - Bug_found("InvalidInputSrc", Input_now->source); // FIXME - add to docs! + Bug_found("IllegalInputSrc", Input_now->source); } // now check for end of statement if (GotByte == CHAR_EOS) @@ -429,7 +429,7 @@ int Input_unescape_dynabuf(int read_index) break; // TODO - 'a' to BEL? others? default: - Throw_error("Unsupported backslash sequence."); // TODO - add to docs (and add unexpected character to error message?) + Throw_error("Unsupported backslash sequence."); // TODO - add unexpected character to error message? } GLOBALDYNABUF_CURRENT[write_index++] = byte; escaped = FALSE; @@ -442,7 +442,7 @@ int Input_unescape_dynabuf(int read_index) } } if (escaped) - Bug_found("PartialEscapeSequence", 0); // FIXME - add to docs! + Bug_found("PartialEscapeSequence", 0); GlobalDynaBuf->size = write_index; return 0; // ok } diff --git a/src/mnemo.c b/src/mnemo.c index 599f25c..426a469 100644 --- a/src/mnemo.c +++ b/src/mnemo.c @@ -1104,7 +1104,7 @@ static void group_prefix(int opcode) { 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); // FIXME - add to docs! + sprintf(buffer, "The chosen CPU uses opcode 0x%02x as a prefix code, do not use this mnemonic!", opcode); Throw_error(buffer); }