In SX Microcontrollers, SX/B Compiler and SX-Key Tool, peterverkaik wrote: I think I know what is going wrong. Look at this listing 1 07F8 0F7F device SX28,oschs1,turbo,stackx,optionx ;sx device options 2 =00000000 irc_cal IRC_SLOW 3 =02FAF080 freq 50_000_000 ;cpu frequency 4 07FF 0A05 reset main 5 expand 6 7 Assign2 macro Name ;create a macro 8 ifndef I??Name 9 org $ 10 I??Name 11 jmp @Name ;create this label from the parameter passed 12 else 13 org $ 14 endif 15 endm ;done 16 17 Assign macro Name ;create a macro 18 ifndef I??Name ;test for the modified parameter passed already exists 19 I??Name 20 jmp @??Name ;create this label from the parameter passed 21 endif 22 endm ;done 23 24 =00000000 org 0 25 ;Assign rx1 26 ;Assign rx2 27 Assign2 rx1 28 m ifndef Irx1 29 m org $ 30 m Irx1 31 m jmp @rx1 ;create this label from the parameter passed 32 m else 33 =00000000 m org $ 34 m endif 36 =00000002 rx1 37 0000 0C01 mov w,#1 38 =00000003 rx2 39 0001 01C4 add w,fsr 40 0002 000C ret 41 =00000005 main 42 0003 0A05 jmp main Cross Reference 9 symbols Symbol Type Value Line __SASM DATA 00000001 0000 __SX_FREQ DATA 02FAF080 0003 __SX_IRC_CAL DATA 00000000 0002 __SX_RESET RESB 00000A05 0004 fsr RESV 00000004 0039 Irx1 ADDR 00000000 0030 main ADDR 00000005 0041 rx1 ADDR 00000002 0036 rx2 ADDR 00000003 0038 The label Irx1 does not exist when calling Assign2, so it gets created (but no code). On the second pass the label exist and the else clause is executed (does generate code). 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=244787#m245756 Need assistance? Send an email to the Forum Administrator at forumadmin@parallax.com The Parallax Forums are powered by dotNetBB Forums, copyright 2002-2008 (http://www.dotNetBB.com)