⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 subs.asm

📁 TIMER.ASM ********* [ milindhp@tifrvax.tifr.res.in ] Set Processor configuration word as = 000
💻 ASM
字号:
; SUBS.ASM
; ********
;read key port in key
read_keys movf newkey, w ;debouncing taken care by s/w
movwf oldkey
movf GPIO, w ;read newkeys
andlw 00011000b ;gp3, gp4 are key ports
movwf newkey
comf newkey, f ;complement since active low
andwf oldkey, w ;key=oldkey AND compl(newkey)
movwf key
;indicate to display routine units or tens key pressed
btfsc key, units_key
bsf digit_inc, units_inc
btfsc key, tens_key
bsf digit_inc, tens_inc
return
;************************************************************
init_ports movlw 0 ;all lo
movwf GPIO
movlw 00011000b ;port g0-g2,g5 o/p & gp3,gp4 i/p
tris GPIO
clrf TMR0 ;clr tmr0 & prescaler
movlw 11000011b ;tmr0 enable with 1:16 prescaler
option
return
;***************** EOF SUBS.ASM ******************************

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -