Shop OBEX P1 Docs P2 Docs Learn Events
issue warning — Parallax Forums

issue warning

Peter VerkaikPeter Verkaik Posts: 3,956
edited 2005-08-05 08:45 in General Discussion
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
·

Comments

  • Paul BakerPaul Baker Posts: 6,351
    edited 2005-07-26 13:43
    You can by specifying an extra parameter to ERROR
    Example: ERROR "message"     ;Pass 2 error
    
             ERROR P1 "message"  ;Pass 1 error
             ERROR P1W "message" ;Pass 1 warning
             ERROR P1C "message" ;Pass 1 comment 
             ERROR P2 "message"  ;Pass 2 error 
             ERROR P2W "message" ;Pass 2 warning 
             ERROR P2C "message" ;Pass 2 comment
    

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    ·1+1=10
  • Peter VerkaikPeter Verkaik Posts: 3,956
    edited 2005-07-26 15:05
    Thanks paul

    regards peter
  • PJMontyPJMonty Posts: 983
    edited 2005-08-05 08:13
    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
  • Peter VerkaikPeter Verkaik Posts: 3,956
    edited 2005-08-05 08:45
    thanks

    regards peter
Sign In or Register to comment.