In SX Microcontrollers, SX/B Compiler and SX-Key Tool, PJMonty wrote: Peter, I also want to mention here that user errors and warnings can use the value of variables to make them more informative. Try cutting and pasting the code below into the SxKey IDE and assembling it. By un-commenting the different defintions for "ThisNodeVar", you can see how the user message can tell you what the value of "ThisNodeVar" is. I often use this in my code for reminding me of things like baud rate or address settings in my projects. [list]Thanks, PeterM[/list] --------------------------------------------------- ; 7/13/04 - This is a generic template to start SX projects with ifdef __SASM DEVICE SX28, turbo, stackx, optionx, OSCHS3 else DEVICE SX28L,turbo,stackx_optionx endif FREQ 50_000_000 ID 'DUMMY' ;Program ID label RESET GotoMain ;Set reset/boot address ifdef __SASM LIST Q=37;, Q=64 ; This quiets specfic SASM warnings irc_cal IRC_FAST endif INT_DURATION equ 200 ; Number of RTCC timer counts for interrupt ; Un-comment either of these to see the user information message use the value of the variable ThisNodeVar equ 5 ;ThisNodeVar equ 7 ; Interrupt code MUST start at address 0 org $00 mov w, #-INT_DURATION ;interrupt every INT_DURATION RTCC clocks retiw ;exit interrupt GotoMain jmp @Main ORG $200 Main ERROR p2w '----------------- Node set to ' ThisNodeVar ' -----------------' ; Clear all file register memory in the chip clr FSR ;Reset all ram starting at 08h :zero_ram sb FSR.4 ;Are we on low half of bank? setb FSR.3 ;If so, don't touch regs 0-7 clr IND ;Clear using indirect addressing ijnz FSR,:zero_ram ;Repeat until done ---------- End of Message ---------- You can view the post on-line at: http://forums.parallax.com/forums/default.aspx?f=7&p=1&m=82108#m83264 Need assistance? Send an email to the Forum Administrator at forumadmin@parallax.com The Parallax Forums are powered by dotNetBB Forums, copyright 2002-2005 (http://www.dotNetBB.com)