We are running a survey to help us improve the experience for all of our members. If you see the survey appear, please take the time to tell us about your experience if you can.
If I execute an instruction: MOV PSW, #07DH what is the active register bank? I believe its bank 2.
"I do not know why you specifically mention the preprocessor ..." The discussion about binary constant macros is not part of the original thread. The original thread about bank selection in assembly language has stopped with Andy's first post. At the end of Andy's first post, he added a side comment (using the word "aside") about C's lack of binary constant notation. A new thread has started on that fork speaks to how some have addressed C's lack of binary notation. That's the thread you are in and were in when you introduced the notion of portability illusion, memory schemes, and I/O schemes. It is the C preprocessor's text replacement and token merging facilities that allow the binary constant macros to work, that's why I specifically mention the preprocessor. It's the part of the toolchain that expands the macros. The binary contant macros and the C preprocessor that have nothing to do with memory, I/O, SFRs, microcontrollers, microprocessors, RISC, CISC, mainframes, etc. You see, it's a text replacement thing. The preprocessor, when expanding the binary constant macros, "translates" a number that is represented in binary notation in the program's source into a normal C integer and produces preprocessed temporary source code output with the integer translations. There is no binary notation in the output passed to the C compiler. Any additional non-portable memory, I/O, SFR stuff for your specific toolchain pass through and are not affected by the binary text replacement. "... I should have said "SFR portability" since the PSW, while a SFR is not I/O" Again, the assembly language PSW (SFR) bank select thread has stopped for the time being with Andy's first post. We're not talking about "SFR portability" (another oxymoron), we're in a forked thread talking about portable binary constant macros.