issue warning
Peter Verkaik
Posts: 3,956
How can I issue a warning in SASM?
error "text" issues an error (the text) and then SASM stops
but
warning "text" generates an error
regards peter
·
error "text" issues an error (the text) and then SASM stops
but
warning "text" generates an error
regards peter
·
Comments
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
·1+1=10
regards 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.
Thanks, PeterM
; 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
regards peter