📄 i51fxa.cod
字号:
/*
* Copyright (c) 1995, Intel Corporation
*
* $Workfile: i51fxa.cod $
* $Revision: 1.2 $
* $Modtime: Apr 20 1995 13:06:20 $
*
* Purpose:
*
*
*
*
*
* Compiler:
*
* Ext Packages:
*
*
*
*/
## ---------------------------- ##
## ---------------------------- ##
## This is the Intel ASM51 code ##
## ---------------------------- ##
## ---------------------------- ##
##80C5? WRITE#
##80C51F? WRITE#
MOV @@REG_MNEM@, #$%aREG_VALUE$
##80C5? READ#
##80C51F? READ#
MOV UserVar, @@REG_MNEM@
##80C5? OR#
##80C51F? OR#
orl @@REG_MNEM@, #$%aREG_VALUE$
##80C5? AND#
##80C51F? AND#
ANL @@REG_MNEM@, #$%aREG_VALUE$
##80C5? XOR#
##80C51F? XOR#
XRL @@REG_MNEM@, #$%aREG_VALUE$
##80C5? TESTZ#
##80C51F? TESTZ#
MOV A, @@REG_MNEM@
JZ ;
##80C5? TESTNZ#
##80C51F? TESTNZ#
MOV A, @@REG_MNEM@
JNZ ;
##80C52 IU#
##80C54 IU#
##80C58 IU#
##80C51FA IU#
##80C51FB IU#
##80C51FC IU#
cseg
; Interrupt Control Unit
$$ifn$IE
; NO INTERRUPTS
$$end$
$$if$IE
; **** Enabled interrupts in Interrupt Enable Register ****
; **** GLOBAL INTERRUPT MUST BE ENABLED FOR ANY OTHER
; **** INTERRUPT TO WORK!
$$if$IE.7
; GLOBAL INTERRUPT ENABLED
$$end$
$$ifN$IE.7
; GLOBAL INTERRUPT DISABLED ALL INTERRUPTS
; ARE DISABLED
$$end$
$$if$IE.0
; External interrupt 0
$$ifn$IPH.0 &! IP.0
; Priority Level = 0
$$end$
$$ifn$IPH.0 && IP.0
; Priority Level = 1
$$end$
$$if$IPH.0 &! IP.0
; Priority Level = 2
$$end$
$$if$IPH.0 && IP.0
; Priority Level = 3
$$end$
$$end$
$$if$IE.1
; Timer 0 interrupt
$$ifn$IPH.1 &! IP.1
; Priority Level = 0
$$end$
$$ifn$IPH.1 && IP.1
; Priority Level = 1
$$end$
$$if$IPH.1 &! IP.1
; Priority Level = 2
$$end$
$$if$IPH.1 && IP.1
; Priority Level = 3
$$end$
$$end$
$$if$IE.2
; External interrupt 1
$$ifn$IPH.2 &! IP.2
; Priority Level = 0
$$end$
$$ifn$IPH.2 && IP.2
; Priority Level = 1
$$end$
$$if$IPH.2 &! IP.2
; Priority Level = 2
$$end$
$$if$IPH.2 && IP.2
; Priority Level = 3
$$end$
$$end$
$$if$IE.3
; Timer 1 interrupt
$$ifn$IPH.3 &! IP.3
; Priority Level = 0
$$end$
$$ifn$IPH.3 && IP.3
; Priority Level = 1
$$end$
$$if$IPH.3 &! IP.3
; Priority Level = 2
$$end$
$$if$IPH.3 && IP.3
; Priority Level = 3
$$end$
$$end$
$$if$IE.4
; Serial Port interrupt
$$ifn$IPH.4 &! IP.4
; Priority Level = 0
$$end$
$$ifn$IPH.4 && IP.4
; Priority Level = 1
$$end$
$$if$IPH.4 &! IP.4
; Priority Level = 2
$$end$
$$if$IPH.4 && IP.4
; Priority Level = 3
$$end$
$$end$
$$if$IE.5
; Timer 2 interrupt
$$ifn$IPH.5 &! IP.5
; Priority Level = 0
$$end$
$$ifn$IPH.5 && IP.5
; Priority Level = 1
$$end$
$$if$IPH.5 &! IP.5
; Priority Level = 2
$$end$
$$if$IPH.5 && IP.5
; Priority Level = 3
$$end$
$$end$
$$if$IE.6
; PCA interrupt
$$ifn$IPH.6 &! IP.6
; Priority Level = 0
$$end$
$$ifn$IPH.6 && IP.6
; Priority Level = 1
$$end$
$$if$IPH.6 &! IP.6
; Priority Level = 2
$$end$
$$if$IPH.6 && IP.6
; Priority Level = 3
$$end$
$$end$
$$end$
init_special_interrupts:
mov IE, #0$$IE$h
mov IP, #0$$IP$h
mov IPH, #0$$IPH$h
ret
main:
lcall init_special_interrupts
end
##80C51FA PCA0#
##80C51FB PCA0#
##80C51FC PCA0#
cseg
;The PCA is set to $%8PCATYPE$No Operation$Capture on positive edge$Capture on Negative edge$Capture on pos/neg edge$Software Timer$High Speed Output $PWM$Watchdog Timer$
;The interrupts should be enabled to operate properly
;Mode = $%4CMOD.1-2$0 Internal Clock, Fosc /12$1 Internal Clock, Fosc /4$2 Timer 0 overflow$3 External Clock $
;PCA Global Interrupt = $%eIE.6$
;PCA Module 0 Interrupt = $%eCCAPM0.0$
;Timer Overflow Interrupt = $%eCMOD.0$
;Counter Idle Control = $%eCMOD.7$
$$if$ PCATYPE
init_pca:
mov CMOD, #0$$CMOD$h
$$if$ (PCATYPE != 7)
mov CL ,#00H ;set by user
mov CH ,#00H ;set by user
$$end$
mov CCAPM0, #0$$CCAPM0$h
mov CCAP0L, #0$$CCAP0L$h
mov CCAP0H, #0$$CCAP0H$h
$$if$ IE.6
setb EC ; IE.6 PCA Interrupt
setb EA ; IE.7 Global Interrupt
$$end$
setb CR ; CCON.6 Turn on PCA timer
$$end$
ret
main:
lcall init_pca
end
##80C51FA PCA1#
##80C51FB PCA1#
##80C51FC PCA1#
cseg
;The PCA is set to $%8PCATYPE$No Operation$Capture on positive edge$Capture on Negative edge$Capture on pos/neg edge$Software Timer$High Speed Output $PWM$Watchdog Timer$
; The interrupts should be enabled to operate properly
;Mode = $%4CMOD.1-2$0 Internal Clock, Fosc /12$1 Internal Clock, Fosc /4$2 Timer 0 overflow$3 External Clock $
;PCA Global Interrupt = $%eIE.6$
;PCA Module 1 Interrupt = $%eCCAPM1.0$
;Timer Overflow Interrupt = $%eCMOD.0$
;Counter Idle Control = $%eCMOD.7$
$$if$ PCATYPE
init_pca:
mov CMOD, #0$$CMOD$h
$$if$ (PCATYPE != 7)
mov CL ,#00H ;set by user
mov CH ,#00H ;set by user
$$end$
mov CCAPM1, #0$$CCAPM1$h
mov CCAP1L, #0$$CCAP1L$h
mov CCAP1H, #0$$CCAP1H$h
$$if$ IE.6
setb EC ; IE.6 PCA Interrupt
setb EA ; IE.7 Global Interrupt
$$end$
setb CR ; CCON.6 Turn on PCA timer
$$end$
ret
main:
lcall init_pca
end
##80C51FA PCA2#
##80C51FB PCA2#
##80C51FC PCA2#
cseg
;The PCA is set to $%8PCATYPE$No Operation$Capture on positive edge$Capture on Negative edge$Capture on pos/neg edge$Software Timer$High Speed Output $PWM$Watchdog Timer$
; The interrupts should be enabled to operate properly
;Mode = $%4CMOD.1-2$0 Internal Clock, Fosc /12$1 Internal Clock, Fosc /4$2 Timer 0 overflow$3 External Clock $
;PCA Global Interrupt = $%eIE.6$
;PCA Module 2 Interrupt = $%eCCAPM2.0$
;Timer Overflow Interrupt = $%eCMOD.0$
;Counter Idle Control = $%eCMOD.7$
$$if$ PCATYPE
init_pca:
mov CMOD, #0$$CMOD$h
$$if$ (PCATYPE != 7)
mov CL ,#00H ;set by user
mov CH ,#00H ;set by user
$$end$
mov CCAPM2, #0$$CCAPM2$h
mov CCAP2L, #0$$CCAP2L$h
mov CCAP2H, #0$$CCAP2H$h
$$if$ IE.6
setb EC ; IE.6 PCA Interrupt
setb EA ; IE.7 Global Interrupt
$$end$
setb CR ; CCON.6 Turn on PCA timer
$$end$
ret
main:
lcall init_pca
end
##80C51FA PCA3#
##80C51FB PCA3#
##80C51FC PCA3#
cseg
;The PCA is set to $%8PCATYPE$No Operation$Capture on positive edge$Capture on Negative edge$Capture on pos/neg edge$Software Timer$High Speed Output $PWM$Watchdog Timer$
; The interrupts should be enabled to operate properly
;Mode = $%4CMOD.1-2$0 Internal Clock, Fosc /12$1 Internal Clock, Fosc /4$2 Timer 0 overflow$3 External Clock$
;PCA Global Interrupt = $%eIE.6$
;PCA Module 3 Interrupt = $%eCCAPM3.0$
;Timer Overflow Interrupt = $%eCMOD.0$
;Counter Idle Control = $%eCMOD.7$
$$if$ PCATYPE
init_pca:
mov CMOD, #0$$CMOD$h
$$if$ (PCATYPE != 7)
mov CL ,#00H ;set by user
mov CH ,#00H ;set by user
$$end$
mov CCAPM3, #0$$CCAPM3$h
mov CCAP3L, #0$$CCAP3L$h
mov CCAP3H, #0$$CCAP3H$h
$$if$ IE.6
setb EC ; IE.6 PCA Interrupt
setb EA ; IE.7 Global Interrupt
$$end$
setb CR ; CCON.6 Turn on PCA timer
$$end$
ret
main:
lcall init_pca
end
##80C51FA PCA4#
##80C51FB PCA4#
##80C51FC PCA4#
cseg
;The PCA is set to $%8PCATYPE$No Operation$Capture on positive edge$Capture on Negative edge$Capture on pos/neg edge$Software Timer$High Speed Output $PWM$Watchdog Timer$
; The interrupts should be enabled to operate properly
;Mode = $%4CMOD.1-2$0 Internal Clock, Fosc /12$1 Internal Clock, Fosc /4$2 Timer 0 overflow$3 External Clock$
;PCA Global Interrupt = $%eIE.6$
;PCA Module 4 Interrupt = $%eCCAPM4.0$
;Timer Overflow Interrupt = $%eCMOD.0$
;Counter Idle Control = $%eCMOD.7$
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -