Page 1 of 1
.Inn and .Ann in ca65 .SMART mode
Posted: Thu Jun 02, 2022 3:05 am
by jeffythedragonslayer
The ca65 documentation doesn't say much about the .Inn and .Ann (pseudo?) instructions, how do I use them?
https://cc65.github.io/doc/ca65.html#ss11.102
Re: .Inn and .Ann in ca65 .SMART mode
Posted: Thu Jun 02, 2022 4:18 am
by tmr4
These directives tell the assembler whether the registers are in 8-bit or 16-bit mode, nothing more. That will determine how the assembler interprets your code, generating 8-bit or 16-bit operands according to the last directive. Once changed, that directive is in effect further down in the source file until it is changed again.
When smart mode is active, the assembler will track SEP/REP instructions to try to determine the mode but this is problematic if your code doesn't have a top to bottom flow.
It's usually recommended to include these commands in macros. See this
post by BDD for example.
Re: .Inn and .Ann in ca65 .SMART mode
Posted: Thu Jun 02, 2022 5:00 am
by jeffythedragonslayer
Oh, 8 and 16 are supposed to be substituted in where the n's are. I see, thanks.