Compiler warning, transfer between Banks
sunruh
Posts: 11
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
·
·· 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
Bean.
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
"SX-Video Display Module" Available Now.
www.sxvm.com
"It's not getting what you want, it's wanting what you've got."
·
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
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
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