Shop OBEX P1 Docs P2 Docs Learn Events
Compiler warning, transfer between Banks — Parallax Forums

Compiler warning, transfer between Banks

sunruhsunruh Posts: 11
edited 2005-05-18 00:24 in General Discussion
I have just downloaded the latest SX-28 compiler and I am noticing a warning when compiling my old code.· I am moving variables between banks as follows:

·· mov w, A
·· bank· bank2
·· mov· bank2var, w

When compiling this code I get a warning·saying "File register not in current bank".· The code runs alright, but I would like to know if I am doing something wrong?

sunruh
·

Comments

  • BeanBean Posts: 8,129
    edited 2005-05-16 16:49
    I think that is a warning that was added. If you know for sure that the bank is set properly you can ignore the warning.
    Bean.

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    "SX-Video Display Module" Available Now.

    www.sxvm.com

    "It's not getting what you want, it's wanting what you've got."
    ·
  • PJMontyPJMonty Posts: 983
    edited 2005-05-17 02:46
    Sunruh,

    What version of the IDE were you running before you upgraded? Also, any chance you can post your code here? I'd like to see why you're getting this warning message if it's not correct.
      Thanks, PeterM
  • sunruhsunruh Posts: 11
    edited 2005-05-17 12:37
    Peter, Below is a snipet of the code which displays to the LCD. The version I was using before was 1.33. Thanks for your help.

    Stan

    initLcd mov w,#254 ; Clear LCD
    call SendByte
    mov w,#1
    call SendByte
    call bitTime
    call bitTime
    call bitTime
    call bitTime
    call bitTime
    call bitTime
    mov w,#65 ; output the letter A for actual threshold
    call SendByte

    mov w,#254 ; move to screen location for display error
    call SendByte
    mov w,#200
    call SendByte
    mov w,#77 ; output the letter M for margin
    call SendByte

    mov w,#254 ; move to screen location for set threshold
    call SendByte
    mov w,#192
    call SendByte
    mov w,#83 ; output the letter S for set point threshold
    call SendByte

    mov w,#254 ; move to screen location for display L for sheet length actual
    call SendByte
    mov w,#136
    call SendByte
    mov w,#76 ; output the letter L
    call SendByte
    jmp @retInit


    ;****************************************************************************
    ;The code below is a subroutine that takes whatever is in W register and
    ;sends it out the pin called SerDat (define in user software).
    ;****************************************************************************

    SendByte mov Lcd1,w
    mov Lcd2,#008h
    setb SerDat ; Start Bit
    call BitTime
    SBloop rr Lcd1 ; Eight Data Bits
    movb SerDat,/c
    call BitTime
    djnz Lcd2,SBloop
    clrb SerDat ; Stop Bit
    call BitTime
    ret

    ;****************************************************************************
    BitTime mov Lcd4, #5 ; was 25
    outLoop mov Lcd3, #206 ; 172 is high limit, 160 is low limit, 166 is sweet, with 25 above
    inLoop dec Lcd3 ; for 96 kbaud, trying 23 and 45, 42 low limit
    jnz inLoop
    dec Lcd4
    jnz outLoop
    ret
  • Lord SteveLord Steve Posts: 206
    edited 2005-05-17 17:16
    bank2var may have an address that is not in bank2.· The high order bits of FSR will be setup properly by the bank instruction and the low order bits of the RAM address come from the· instruction "mov bank2var, w".· So, it would work no matter which bank bank2var was in--as long as its offset from the beginning of the bank was consistent.
  • PJMontyPJMonty Posts: 983
    edited 2005-05-18 00:24
    Sunruh,

    First, version 1.33 of the IDE uses the Parallax assembler which doesn't provide the bank warning message.

    Second, I really can't tell squat from the snippet. Since your problem is related to bank issues, not including the code that sets up the variables makes it impossible to tell if the problem is your code or the assembler. Try making a TINY program, the smallest that you can make, that demonstrates the problem and post it here. The program doesn't have to be functional, it just has to assemble and demonstrate the problem. It pretty much just needs the variables in question and the function that does the byte copying.
      Thanks, PeterM
Sign In or Register to comment.