From 372eea385dbf413c1ec38e8f4faba8a720eeb3b4 Mon Sep 17 00:00:00 2001
From: Andy McFadden
Date: Fri, 26 Oct 2018 15:59:00 -0700
Subject: [PATCH] Clarify
---
SourceGen/RuntimeData/Help/codegen.html | 20 ++++++++++++--------
1 file changed, 12 insertions(+), 8 deletions(-)
diff --git a/SourceGen/RuntimeData/Help/codegen.html b/SourceGen/RuntimeData/Help/codegen.html
index 55e4363..7f4021b 100644
--- a/SourceGen/RuntimeData/Help/codegen.html
+++ b/SourceGen/RuntimeData/Help/codegen.html
@@ -175,8 +175,8 @@ code, but also needs to know how to handle the corner cases.
and assemblers like 64tass do it the other way around. So cc65
regards the expression as (label >> 8) - 16
, while the
more common interpretation would be label >> (8 - 16)
.
- (This is actually somewhat convenient, since many common expressions
- don't require parenthesis.)
+ (This is actually somewhat convenient, since none of the expressions
+ SourceGen currently generates require parenthesis.)
Undocumented opcodes: SBX ($cb) uses the mnemonic AXS. All other
opcodes match up with the "unintended opcodes" document.
@@ -194,16 +194,20 @@ code, but also needs to know how to handle the corner cases.
Quirks:
- - Operator precedence is unusual. Expressions are processed from
- left to right, with no operator precedence.
+ - Operator precedence is unusual. Expressions are generally processed
+ from left to right. The byte-selection operators have a lower
+ precedence than all of the others, and so are always processed last.
- The byte selection operators ('<', '>', '^') are actually
word-selection operators, yielding 16-bit values when wide registers
are enabled on the 65816.
+ - Values loaded into registers are implicitly mod 256 or 65536. There
+ is no need to explicitly mask an expression.
- The assembler tracks register widths when it sees SEP/REP instructions,
- but doesn't attempt to track the emulation flag. So if the registers
- are long when you switch to emulation, incorrect code is generated.
- (Really I just want to be able to turn the auto-tracking off.)
- - Non-unique local labels don't cause an error.
+ but doesn't attempt to track the emulation flag. So if you issue a REP
+ while in emulation mode, the assembler will incorrectly assume long
+ registers. (Really I just want to be able to turn the width-tracking
+ off, but there's no way to do that.)
+ - Non-unique local labels should cause an error, but don't.