📄 macros.inc
字号:
SELRB1 MACRO
setb psw.3
ENDM
SELRB0 MACRO
clr psw.3
ENDM
;
SETBIT MACRO ad,dat
mov dptr,#ad
movx a,@dptr
setb acc.dat
movx @dptr,a
ENDM
;
CLRBIT MACRO ad,dat
mov dptr,#ad
movx a,@dptr
clr acc.dat
movx @dptr,a
ENDM
;
CLR_USB_IRQ MACRO
mov a,EXIF
clr acc.4
mov EXIF,a
ENDM
;
ENABLE_USB_INTS MACRO
setb EIE.0
ENDM
DISABLE_USB_INTS MACRO
clr EIE.0
ENDM
ENABLE_USB_AV MACRO
SETBIT INTSETUP,bAV2EN
ENDM
CLEAR_USB_IRQ MACRO
CLRBIT EXIF,bINT2
ENDM
;
JBH MACRO ad,b,des ; jump on bit high
mov dptr,#ad
movx a,@dptr
jb acc.b,des
ENDM
JBL MACRO ad,b,des ; jump on bit low
mov dptr,#ad
movx a,@dptr
jnb acc.b,des
ENDM
;
LDREG MACRO ad,val ; Set register with value
mov a,val
mov dptr,#ad
movx @dptr,a
ENDM
;
PUSHALL MACRO
push dpl
push dph
push acc
ENDM
;
POPALL MACRO
pop acc
pop dph
pop dpl
ENDM
;
L1_ON MACRO
mov dptr,#0B000h
movx a,@dptr
ENDM
L2_ON MACRO
mov dptr,#0A000h
movx a,@dptr
ENDM
L3_ON MACRO
mov dptr,#09000h
movx a,@dptr
ENDM
L4_ON MACRO
mov dptr,#08000h
movx a,@dptr
ENDM
L1_OFF MACRO
mov dptr,#0B100h
movx a,@dptr
ENDM
L2_OFF MACRO
mov dptr,#0A100h
movx a,@dptr
ENDM
L3_OFF MACRO
mov dptr,#09100h
movx a,@dptr
ENDM
L4_OFF MACRO
mov dptr,#08100h
movx a,@dptr
ENDM
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -