Temp equ 01Bh ; temporary register
HIndex equ 01Ch ; index register
LEDIndex equ 01Dh ; LED pointer
;--------------------------------------------------------------------------
include <t1234led.inc> ; timing loop values
;--------------------------------------------------------------------------
org 0
Start clrf Index
clrf LEDIndex
clrf LED0
clrf LED1
clrf LED2
clrf LED3
clrf LED4
clrf LED5
clrf LED6
clrf LED7
clrf LowB
clrf MidB
clrf HigB
bsf STATUS,RP0
MOVlw b’00010000’ ; RA0..RA3 outputs
MOVwf TRISA ; RA4 input
MOVlw b’00000000’ ; RB0..RB7 outputs
MOVwf TRISB
clrwdt ;
MOVlw b’00100111’ ; Prescaler -> TMR0,
MOVwf OPTION_REG ; 1:256, rising edge
bcf STATUS,RP0 ;
goto Go ; line 370
;+-------------------------------------------------------------------------+
;| The bLOCk of subroutines and constants tables |
;+-------------------------------------------------------------------------+
;+-------------------------------------------------------------------------+
;| 3 byte substraction of the constant from the table, it sets carry |
;| if result is negative |
;+-------------------------------------------------------------------------+
Subc24 clrf Temp ; it will temporary save CF
MOVf Index,W ; pointer to low byte of constant
MOVwf HIndex ; W -> HIndex
call DecTable ; W returned with low byte of constant
bsf STATUS,C ; set CF
subwf LowB,F ; LowB - W -> LowB
; if underflow -> C=0
btfsc STATUS,C
goto Step1
bsf STATUS,C
MOVlw 1
subwf MidB,F ; decrement MidB
; if underflow -> C=0
上一页 [1] [2] [3] [4] [5] [6] [7] [8] [9] [10] [11] [12] 下一页
本文关键字:暂无联系方式PIC单片机,单片机-工控设备 - PIC单片机