Computer Laboratory Assignments
Computer Laboratory Assignments
;====================================================================
; DEFINITIONS
;====================================================================
org 0x0
BSF STATUS,5
BSF TRISA,0
BCF TRISB,3
BCF STATUS,5
CLRF PORTA
CLRF PORTB
MOVLW D'7'
MOVWF DELAY
L1
BTFSS PORTA,0
GOTO L1
L2
DECFSZ DELAY
GOTO L2
LOOP
BSF PORTB,3
GOTO LOOP
END
FOR QUESTION 2
;====================================================================
; Main.asm file generated by New Project wizard
;
; Created: Thu Feb 11 2021
; Processor: PIC16F84A
; Compiler: MPASM (Proteus)
;====================================================================
;====================================================================
; DEFINITIONS
;====================================================================
BSF STATUS,5
BSF TRISA,0
BCF TRISB,3
BCF STATUS,5
CLRF PORTA
CLRF PORTB
LOOP
MOVLW D'7'
MOVWF DELAY
L1
BTFSS PORTA,0
GOTO L1
L2
DECFSZ DELAY
GOTO L2
BSF PORTB,3
NOP
BCF PORTB,3
GOTO LOOP
END
FOR QUESTION 3
;====================================================================
; Main.asm file generated by New Project wizard
;
; Created: Thu Feb 11 2021
; Processor: PIC16F84A
; Compiler: MPASM (Proteus)
;====================================================================
;====================================================================
; DEFINITIONS
;====================================================================
org 0x0
BSF STATUS,5
BCF TRISB,2
BCF STATUS,5
CLRF PORTB
MOVLW D'41'
LOOP
MOVWF DELAY1
MOVWF DELAY2
BSF PORTB,2
L1
DECFSZ DELAY1,1
GOTO L1
BCF PORTB,2
L2
DECFSZ DELAY2,1
GOTO L2
GOTO LOOP
END
for QUESTION 4
;====================================================================
; Main.asm file generated by New Project wizard
;
; Created: Thu Feb 11 2021
; Processor: PIC16F84A
; Compiler: MPASM (Proteus)
;====================================================================
;====================================================================
; DEFINITIONS
;====================================================================
org 0x0
BSF STATUS,5
BCF TRISB,1
BSF TRISA,0
BCF STATUS,5
LOOP
MOVLW D'7'
MOVWF DELAY1
TEST
BTFSC PORTA,0
GOTO TEST
BSF PORTA,1
L1
DECFSZ DELAY1
GOTO L1
BCF PORTB,1
NOP
NOP
NOP
GOTO LOOP
END