4.58 set-DEFINEANASSEMBLERVARIABLE 4.58.1 Syntax Preferred: label set expr Supported: label .set expr 4.58.2 Description label is assigned the value of the valid MPASM assembler expression specifi= ed by expr. The set directive is functionally equivalent to the equ directi= ve except that set values may be subsequently altered by other set directiv= es. 4.58.3 Usage This directive is used in the following types of code: absolute or relocata= ble. For information on types of code, see Section 1.6 =93Assembler Operati= on=94. Because set directive values may be altered by later set directives, set is= particularly useful when defining a variable in a loop (e.g., a while loop= ..) 4.58.4 See Also equ variable while 4.58.5 area width length area length 4.58.6 Simple Example set 0 set 0x12 set 0x14 set length * width set length + 1 Application Example - set/equ This example shows the usage of the set directive, used for creating symbol= s which may be used in MPASM assembler expressions only. The symbols create= d with this directive do not occupy any physical memory location on the mic= rocontroller. #include p16f877a.inc perimeter set 0 area set 0 ;Include standard header file ;for the selected device. ;The label 'perimeter' is ;assigned value 0. ;The label 'area' is assigned = ;value 0. The value assigned by the set directive may be reassigned later. lngth wdth equ 50H equ 25H ;The label 'lngth' is assigned ;the value 50H. ;The label 'wdth' is assigne= d ;the value 25H. DS33014K-page 108 =A9 2009 Microchip Technology Inc.Directives The value assigned by the equ directive may not be reassigned later. perimeter set 2*(lngth+wdth) ;Both 'perimeter' and area set lngth*wdth ;'ar= ea' values are end 4.59 space-INSERTBLANKLISTINGLINES 4.59.1 Syntax Preferred: space expr Supported: spac expr 4.59.2 Description and Usage Insert expr number of blank lines into the listing file. This directive is = used in the following types of code: absolute or relocatable. For information on types of code, see Section 1.6 =93Assembler Operation=94. 4.= 59.3 See Also list 4.59.4 Simple Example space 3 ;Inserts three blank lines 4.60 subtitle-SPECIFYPROGRAMSUBTITLE 4.60.1 Syntax Preferred: subtitle "sub_text" Supported: stitle "sub_text" subtitl "sub_text" 4.60.2 Description and Usage sub_text is an ASCII string enclosed in double quotes, 60 characters or les= s in length. This directive establishes a second program header line for us= e as a subtitle in the listing output. This directive is used in the following types of code: absolute or relocata= ble. For information on types of code, see Section 1.6 =93Assembler Operati= on=94. 4.60.3 See Also list title 4.60.4 Simple Example subtitle "diagnostic section" ;reassigned. On Jun 22, 2011, at 9:21 AM, smplx wrote: >=20 > Most assemblers I have used would let you use SET in this way. I don't us= e=20 > microchip's assembler though so I couldn't say for sure that it behaves=20 > like the majority of others. >=20 > HOWEVER - from my experience, I would suggest that you look around your=20 > code to see if "link" is SET anywhere else. What could be happening is=20 > that "link" is actually being left with some other value in it AFTER it=20 > has been SET to "$". >=20 > Try changing the symbol name from "link" to "link314156" and see if your > problem goes away. >=20 > Also are you sure that "SET" is a directive for this assembler and not a= =20 > macro? >=20 > Regards > Sergio Masci >=20 >=20 > On Wed, 22 Jun 2011, Isaac Marino Bavaresco wrote: >=20 >> You must explain in more details what you want and what you are doing, >> so we can understand it better. >>=20 >> What follows the definition of the symbol 'link'? >> Where do you redefine the symbol again? And Where do you use the new >> value? Can't you simply use a different symbol for each instance? >>=20 >> Is this code fragment defined inside a macro? If so you could use the >> 'local' directive to define a local symbol. >>=20 >>=20 >> Best regards, >>=20 >> Isaac >>=20 >>=20 >>=20 >> Em 21/6/2011 17:17, Thomas Sefranek escreveu: >>> I need the ability to redefine the label, it is the link in the diction= ary. >>>=20 >>> On Jun 21, 2011, at 3:57 PM, Isaac Marino Bavaresco wrote: >>>=20 >>>> Em 21/6/2011 16:25, Thomas Sefranek escreveu: >>>>>> This works in absolute mode! >>>>> I see in the listing the address, but the assembler doesn't. >>>>>=20 >>>>> 00078E 0000 00334 DW link ; Form th= e dictionary link address for "skip". >>>>> Error[151] : Operand contains unresolvable labels or is too complex >>>>> 00000000 00335 link SET $ ; Define th= e dictionary link address for "skip" here. >>>>>=20 >>>>> Tom >>>>=20 >>>> I think you should not use 'SET', but rather define a normal label: >>>>=20 >>>> link: >>>>=20 >>>> 'SET' doesn't create a symbol in the OBJ's symbol table. > --=20 > http://www.piclist.com PIC/SX FAQ & list archive > View/change your membership options at > http://mailman.mit.edu/mailman/listinfo/piclist --=20 http://www.piclist.com PIC/SX FAQ & list archive View/change your membership options at http://mailman.mit.edu/mailman/listinfo/piclist .