.Inn and .Ann in ca65 .SMART mode

Building your first 6502-based project? We'll help you get started here.
Post Reply
jeffythedragonslayer
Posts: 114
Joined: 03 Oct 2021

.Inn and .Ann in ca65 .SMART mode

Post 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
tmr4
Posts: 147
Joined: 19 Feb 2022

Re: .Inn and .Ann in ca65 .SMART mode

Post 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.
jeffythedragonslayer
Posts: 114
Joined: 03 Oct 2021

Re: .Inn and .Ann in ca65 .SMART mode

Post by jeffythedragonslayer »

Oh, 8 and 16 are supposed to be substituted in where the n's are. I see, thanks.
Post Reply