PBP array in ASM statements


Results 1 to 20 of 20

Threaded View

  1. #6
    Join Date
    Sep 2004
    Location
    montreal, canada
    Posts
    6,898


    Did you find this post helpful? Yes | No

    Default Re: PBP array in ASM statements

    weird... a simple loop works here,

    Code:
    start:
        asm
            incf _MyArray,F
            incf _MyArray+1,F
        endasm    
        myvar=myarray[0]
        myvar2=myarray[1]
        goto start
    but as you're using a blend mix of ASM and PBP in an ISR, you must make sure you're always on the good BANK case not, hell yeah it may goes to lalaland... what you could try is to set all variable that goes in the ISR to BANKA.

    And yes I know I miss something

    EDIT: The more I think, the more it looks like a bank switching issue,
    Code:
        MyArray VAR BYTE[8] BANK1
        
        MyVar var byte BANK0
        MyVar2 var byte BANK0
        clear
    
    start:
        asm
            CHK?RP _MyArray
            incf _MyArray,F
            incf _MyArray+1,F
        endasm    
        pause 500
        myvar=myarray[0]
        myvar2=myarray[1]
        goto start
    The above work... commentout the CHK?RP line.. and nope... it doesn't.

    And NOPE, BANK0 !=BANKA
    Code:
    BANKA   $0000, $005F
    BANK0   $0060, $00FF
    Finger crossed before the real ASM/Compiler gurus came here and slap me a good one
    Last edited by mister_e; - 28th May 2011 at 21:58.
    Steve

    It's not a bug, it's a random feature.
    There's no problem, only learning opportunities.

Members who have read this thread : 0

You do not have permission to view the list of names.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts