In SX Microcontrollers, SX/B Compiler and SX-Key Tool, rodneymc wrote: I'm still converting code from sx28 to sx48, and looking for some tips with the following: I have a word variable in bank $60 called TickTimer Im passing a byte into the sub and have aligned the value to be in the same bank ($60) Sub Setit tmptimerB1 = __PARAM1 \ BANK Timing TickTimer = 12590 / tmpTimerB1 TickTimer = TickTimer + tmpTimerW1 \ BANK $00 ENDSUB First of all, I'm finding that I need to add ASM bank statements in order for it to start right. Secondly, when running through SXSim, the banks are not updatating to bank $60 to do the calculation correctly when accessing the TickTimer_LSB and _MSB bytes. Do I need to go to assembly and add the necessary bank statments for it to work correctly? Note Bold code updates at BANK $00 Thanks again! [code] MOV __PARAM1,#12590& 255 ; tmpTimerW1 = 12590 / tmpTimerB1 MOV __PARAM2,#12590 >> 8 MOV FSR,#tmpTimerB1 MOV __PARAM3,IND CLR __PARAM4 CLR FSR [b]CLR tmpTimerW1_LSB CLR tmpTimerW1_MSB[/b] MOV W,__PARAM3 OR W,__PARAM4 JZ @$+41 CLR __PARAM5 JMP @$+5 CLC RL __PARAM3 RL __PARAM4 INC __PARAM5 JNB __PARAM4.7,@$-4 JMP @$+7 CLC [b]RL tmpTimerW1_LSB RL tmpTimerW1_MSB[/b] [/code] ---------- End of Message ---------- You can view the post on-line at: http://forums.parallax.com/forums/default.aspx?f=7&p=1&m=454280 Need assistance? Send an email to the Forum Administrator at sysadmin@parallax.com The Parallax Forums are powered by dotNetBB Forums, copyright 2002-2010 (http://www.dotNetBB.com)