In SX Microcontrollers, SX/B Compiler and SX-Key Tool, peterverkaik wrote: Jon, There is a problem in PUT_WORD [code] SUB PUT_WORD ASM MOV __PARAM5, FSR ' save current bank MOV W, __PARAM1 ' start of array CLC RL __PARAM2 ' index *= 2 ADD W, __PARAM2 MOV FSR, W ' FSR = array(index) MOV IND, __PARAM3 INC FSR ' FSR = array(index+1) SB __PARAMCNT.2 ' skip next if word CLR __PARAM4 ' else clear MSB if byte MOV IND, __PARAM4 MOV FSR, __PARAM5 ' restore bank ENDASM ENDSUB [/code]You save fsr in __param5, but later on you test __paramcnt. Since __paramcnt is aliased to __param5 this will not work. Better to change PUT_WORD to always use word values (or extend bytevalues to wordvalues) PUT_WORD SUB 4, 4, byte, byte, word __paramcnt is not used then. regards peter ---------- End of Message ---------- You can view the post on-line at: http://forums.parallax.com/forums/default.aspx?f=7&p=1&m=332288#m332451 Need assistance? Send an email to the Forum Administrator at forumadmin@parallax.com The Parallax Forums are powered by dotNetBB Forums, copyright 2002-2009 (http://www.dotNetBB.com)