SXB 48 and Bank Select
I have been trying to put together a program for an SX-48 in SXB that includes the bank select macro.· I find that if I·put the _bank macro in as assembler code ie ASM _bank macro defination it will not properly carry all of the macro instructions to the assembler.· if I leave the macro out of the SX_B program it sees _bank as an error Bad Instruction.· How can I get SXB to accept the _bank macro, I hate to have to hand code every occurance where I wish to use bank.·
· What I am seeing is that the macro is carried to the assemble with missing information.· ie bank \1 is just carried as \1!

Comments
The compiler gets confused by the embedded "\" character in the macro. (This is fixed in the beta version).
The workaround is to either put the assembly code in another file and use INCLUDE "Macros.src" or prefix each line with a "\" instead of using ASM...ENDASM
Bean.
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
"A government big enough to give you everything you want, is big enough to take away everything you·have."·· Thomas Jefferson
www.iElectronicDesigns.com
·
I did discover that SXB was a bit smarter than I thought, I removed the _ from Macro calls and found that SXB was compiling correctly.· As I understand your code, however, I need to put the macro code back in with the include file so that I properly change FSR.7.
Thanks again
Ray
SX/B does handle the bank switching if you are using SX/B code. It's when you want to add assembly code that you must handle it yourself.
I assume this _BANK macro was part of some assembly library.
It gets really tricky when you start doing bank switching within SX/B. You have to do alot of workarounds to get it to work. It's much easier in SX/B 2.0 because it allows you to declare variables at specific RAM location that will still be treated as a regular variable.
Bean.
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
"A government big enough to give you everything you want, is big enough to take away everything you·have."·· Thomas Jefferson
"It is our choices, Harry, that show what we truly are, far more than our abilities."·Dumbledore from Harry Potter
www.iElectronicDesigns.com
·
your are correct in that the _macro code was from an assembly library. I got it working corectly with your help. Just a minor glitch in that I can not read a dip switch on Port C with the ppl set to on ad ddir set to in and latch set to 0. Got to go back and check what is happening. By the way, is there a way to print out a listing file?
Thanks
Jim