I'm developing a banked program: BANK0 and BANK1 :program BANK2: constants I can't execute long SWITCH statements in functions located at bank1. That't because the big switchs utilizes C?CCASE to resolve its possibilities, and somehow C?CCASE is not working right in the banked mode. How do I force ALL the switchs of my program to be implemented as jumps? Thanks!
I can't execute long SWITCH statements in functions located at bank1. That't because the big switchs utilizes C?CCASE ... How do I force ALL the switchs of my program to be implemented as jumps? Switch-case statements should work in any bank. The C?CCASE routine uses offsets that are stored in CONST (or CODE) space --usually following the call to C?CCASE. If you move all const stuff to a different code bank, the CCASE function won't be able to find the correct case offsets and will jump to indeterminate addresses. There are several solutions to this kind of problem. 1. Locate all of your functions that have switch statements into the common area. 2. Locate the function with switch statements into bank 2 (where constants are stored). 3. Don't put constants into a code bank (they do take longer to access if they're in a code bank). I know that this may not be an option. 4. Force constants from files with switches into the same bank as the rest of the function. Jon
The C?CCASE routine uses offsets that are stored in CONST (or CODE) space --usually following the call to C?CCASE.. When you say "following the call":
E CALL ?C?ICASE R DW ?C0126 DW 08000H R DW ?C0128 DW 09000H R DW ?C0130 DW 0A000H R DW ?C0132 DW 0B000H R DW ?C0126 DW 0C000H R DW ?C0128 DW 0D000H R DW ?C0130 DW 0E000H R DW ?C0132 DW 0F000H DW 00H R DW ?C0124 ; SOURCE LINE # 1237 ; SOURCE LINE # 1238 ; SOURCE LINE # 1239 ?C0126:
START STOP LENGTH ALIGN RELOC MEMORY CLASS SEGMENT NAME ========================================================================= *** COMMON AREA *** 0032D2H 003358H 000087H BYTE UNIT CODE ?CO?ALARMS * * * * * * * * * * * C O D E M E M O R Y * * * * * * * * * * * * * *** CODE BANK 1 *** 00A337H 00A3D3H 00009DH BYTE UNIT CODE/B1 ?PR?ALARMPOLL?ALARM
Which device are you using? Has your device any restrictions in executing MOVC insturctions?