X-Git-Url: http://www.chiark.greenend.org.uk/ucgi/~ijackson/git?a=blobdiff_plain;f=detpic%2Fcommon.inc;fp=detpic%2Fcommon.inc;h=116c007b16f46e551c0512ead9114bef0d24dd17;hb=3072eaa5bd8270b67c56377111f241c787e48a05;hp=f54e81806781f949fa4a0d94ca42fffbcc0051a8;hpb=ea7d37bc26624e59e4a302aa9933fd01af76f8cf;p=trains.git diff --git a/detpic/common.inc b/detpic/common.inc index f54e818..116c007 100644 --- a/detpic/common.inc +++ b/detpic/common.inc @@ -122,11 +122,48 @@ tickdiv_us equ tick_us * tickdiv @ macro endm -D macro v - mov_lw v +;---------------------------------------- +; For adding a byte to the debug buffer. +; Not for use in High ISR. In all cases: +; +; STATUS any trashed +; all others any preserved + + ifndef NDEBUG +;---------- +Dv macro ; sorry, but assembler's dw directive isn't case-sensitive +; +; W message byte preserved +; call debugbyte endm +;---------- +Dl macro debug_literal_value +; +; W any literal value as specified +; + mov_lw debug_literal_value + Dv + endm + +;---------- +Df macro debug_register_file_address +; +; W any value from specified memory location +; + mov_fw debug_register_file_address + Dv + endm + else +Dv macro + endm +Dl macro debug_literal_value + endm +Df macro debug_register_file_address + endm + endif + ;---------------------------------------- ; For entering and leaving Low ISR, saving and restoring STATUS and W ; See above under _intrl, and {master,slave}_interrupt_low