[Flashforth-devel] Conditional debug statements
Brought to you by:
oh2aun
From: Tristan W. <ho...@tj...> - 2023-05-24 06:22:30
|
Debug statements that are in compiled code when you want them but not when you don't. This is a variation on ?\ https://sourceforge.net/p/flashforth/discussion/726813/thread/6257e78a31/?limit=25#cfcb but can be used within a colon definition. Best wishes Tristan _debug_ marker _debug_ true value DEBUG : || DEBUG invert if postpone \ then ; immediate : ex1 cr || [char] + || emit cr [char] * emit cr ; false to DEBUG : ex2 cr || [char] + || emit cr [char] * emit cr ; ex1 + * ok<$,ram> ex2 * ok<$,ram> see ex1 5b20 ecc9 call cr 5b24 0e2b movlw 2b 5b26 6eec movwf (+sp) a 5b28 6aec clrf (+sp) a 5b2a ec88 call emit 5b2e ecc9 call cr 5b32 0e2a movlw 2a 5b34 6eec movwf (+sp) a 5b36 6aec clrf (+sp) a 5b38 ec88 call emit 5b3c efc9 goto cr see ex2 5b46 ecc9 call cr 5b4a 0e2a movlw 2a 5b4c 6eec movwf (+sp) a 5b4e 6aec clrf (+sp) a 5b50 ec88 call emit 5b54 efc9 goto cr |