0% found this document useful (0 votes)
12 views4 pages

Computer Laboratory Assignments

Laboratory on Matlab for computer engineers

Uploaded by

jimmyiniobong43
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as TXT, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
12 views4 pages

Computer Laboratory Assignments

Laboratory on Matlab for computer engineers

Uploaded by

jimmyiniobong43
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as TXT, PDF, TXT or read online on Scribd
You are on page 1/ 4

;====================================================================

; Main.asm file generated by New Project wizard


;
; Created: Thu Feb 11 2021
; Processor: PIC16F84A
; Compiler: MPASM (Proteus)
;====================================================================

;====================================================================
; DEFINITIONS
;====================================================================

#include p16f84a.inc ; Include register definition file

org 0x0

DELAY EQU 0CH

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
;====================================================================

#include p16f84a.inc ; Include register definition file


org 0x0

DELAY EQU 0CH

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
;====================================================================

#include p16f84a.inc ; Include register definition file

org 0x0

DELAY1 EQU 0CH


DELAY2 EQU 1CH

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
;====================================================================

#include p16f84a.inc ; Include register definition file

org 0x0

DELAY1 EQU 0CH

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

You might also like