This discussion has been locked.
You can no longer post new replies to this discussion. If you have a question you can start a new discussion

SWITCH in banked mode

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!

Parents
  • 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:
    

    Wouldn't these DW's be part of the ?CO?module segment? Or are they literally "following the call" in the ?PR? segment?

    I assume from the discussion thus far that it's the former. Otherwise, you wouldn't be able to relocate the constants in a bank different from the code, as they'd be all one segment and relocated together.

    If they're in the ?CO? segment, it would also answer my question about why I'm getting lucky; my ?CO? segments for these modules happen to be in the common bank.

    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
    

Reply
  • 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:
    

    Wouldn't these DW's be part of the ?CO?module segment? Or are they literally "following the call" in the ?PR? segment?

    I assume from the discussion thus far that it's the former. Otherwise, you wouldn't be able to relocate the constants in a bank different from the code, as they'd be all one segment and relocated together.

    If they're in the ?CO? segment, it would also answer my question about why I'm getting lucky; my ?CO? segments for these modules happen to be in the common bank.

    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
    

Children