Replies: 1 comment
-
Yes, this will kick in the inference typing.
…--Fred
On Tuesday, April 11, 2023 at 04:27:14 PM EDT, Bernd Böckmann ***@***.***> wrote:
In rare cases one wants to generate a three byte-instruction while the assembler generates an optimized two-byte instruction. Some assemblers have a type cast operator or similar to force a byte argument to be of type word.
ASM6502 has no special type cast feature but solves this problem in a different way:
lda 1 ; two-byte instruction, argument is of type byte
lda 1+0000 ; three-byte instruction, argument is of type word
The solution is to add a zero of type word. A decimal number is of type word if it has four digits, so 0000 is of type word.
—
Reply to this email directly, view it on GitHub, or unsubscribe.
You are receiving this because you are subscribed to this thread.Message ID: ***@***.***>
|
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
In rare cases one wants to generate a three byte-instruction while the assembler generates an optimized two-byte instruction.
The solution is to either add a zero of type word, or use the conversion operator
[w]
. A decimal number is of type word if it has four digits, so 0000 is of type word. Alternatively all hex values of three or more digits are considered of type word. So adding $000 yields the same result.The code generated is
Beta Was this translation helpful? Give feedback.
All reactions