In SX Microcontrollers, SX/B Compiler and SX-Key Tool, ems1965 wrote: OK I got it working now... The Revised Code is below with two minor changes. Thanks Jonny for the code. [code] [code] tmpB1 VAR Byte tmpW1 VAR Word myWords VAR Byte (8) [/code] Declare a subroutine and function [code] PUT_WORD SUB 2, 3 GET_WORD FUNC 2, 1 [/code] And here is the code for those declarations: [code] ' Use: PUT_WORD index, value ' PUT_WORD: tmpB1 = __PARAM1 IF __PARAMCNT = 1 THEN tmpW1 = __PARAM2 ELSE tmpW1 = __WPARAM23 ENDIF tmpB1 = tmpB1 << 1 myWords(tmpB1) = tmpW1_LSB ' I changed this line INC tmpB1 myWords(tmpB1) = tmpW1_MSB ' I changed this line RETURN ' Use: value = GET_WORD index ' GET_WORD: tmpB1 = __PARAM1 tmpB1 = tmpB1 << 1 tmpW1_LSB = myWords(tmpB1) INC tmpB1 tmpW1_MSB = myWords(tmpB1) RETURN tmpW1 [/code] ---------- End of Message ---------- You can view the post on-line at: http://forums.parallax.com/forums/default.aspx?f=7&p=1&m=176740#m181233 Need assistance? Send an email to the Forum Administrator at forumadmin@parallax.com The Parallax Forums are powered by dotNetBB Forums, copyright 2002-2007 (http://www.dotNetBB.com)