SN8P2604
8-Bit Micro-Controller
SONiX TECHNOLOGY CO., LTD
Page 105
Version 1.1
11.5.7 OTHER MACRO
A macro routine includes many instructions. It will be error after test instruction with skipping function.
BTS0
BUF.0
@RST_WDT
JMP TEST_CODE
…
TEST_CODE:
…
BTS0 instruction skipping function only skip one instruction. @RST_WDT is a macro and composed of several
instructions. The skipping function of above routine would be error. It can’t skip to “JMP TEST_CODE” successfully.
Using following routines can solve the problem.
BTS0
BUF.0
JMP CLR_WDT
JMP TEST_CODE
…
CLR_WDT:
@RST_WDT
…
TEST_CODE:
…
SN8IDE provides user defined forward/backward jump directive to processing skipping function easier. “Macro_Start”
and “Macro_End” is user define label name. Using
@@.Macro_Start
and
@@.Macro_End
to syntax. These lable
names can be repeated in main program.
BTS0
BUF.0
JMP @F.Macro_Start
; Jump to nearest user define @@.Macro_Start:
JMP @F.Macro_End
; Jump to nearest user define @@.Macro_End:
…
@@.Macro_Start:
@RST_WDT
@@.Macro_End:
TEST_CODE:
…
Note: Only S8ASM V1.99L or later version support user defined forward/backward jump directive!
Note: Macro possible affects Accumulator and PFLAG result. Users have to check it!