tuta6 microcontrollers and electronics,
DESCRIPTION
microcontrollers and electronics,MCU Unit,beginners course,TRANSCRIPT
; TUTA6.ASM 11MAR02; as TUTA4 but using Z and RRF
;::::::::::::::::::::::::::::::::::::::::::::::::::::::::: ; Configuration data ; PICmicro MCU type: 16F84 ; Oscillator: RC mode, slow, VR1 fully clockwise (max.rate) ; LCD display: off ; 7-segment display: off ; Version 2 board settings: J14 links: Digital ;::::::::::::::::::::::::::::::::::::::::::::::::::::::::: ;; The following line embeds configuration data into the PICmicro
__CONFIG H'3FFB' ; RC mode;:::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
#DEFINE PAGE0 BCF STATUS,5#DEFINE PAGE1 BSF STATUS,5
STATUS EQU H'03' ;TRISB EQU H'86' ;PORTB EQU H'06' ;W EQU 0 ; WorkingF EQU 1 ; FileC EQU 0 ; CarryZ EQU 2 ; Zero
ORG 0 ; Reset vectorGOTO 5 ; Goto start of programORG 4 ; Interrupt vectorGOTO 5 ; Goto start of programORG 5 ; Start of program memory
CLRF PORTB ;PAGE1 ;CLRF TRISB ;PAGE0 ;
LOOP1 MOVLW D'128' ; load value of 128 into Working register
MOVWF PORTB ; load this value (10000000) into Port B
BCF STATUS,C ; clear Carry bit
LOOP2 RRF PORTB,F ; rotate value of PORTB right by 1 logical place
MOVF PORTB,F ; cause status of Zero bit to be registered
; (the command movf PORTB,W has the same effect)
BTFSS STATUS,Z ; check if the Zero flag (bit 2) of the STATUS
; register has been set to high, indicating that
; PORTB has returned to a value 0 after it has been