Academic Integrity: tutoring, explanations, and feedback — we don’t complete graded work or submit on a student’s behalf.

Electronic technology and microprocessor FACULTY OF ENGINEERING TECHNOLOGY BNJ 3

ID: 2266695 • Letter: E

Question


Electronic technology and microprocessor

FACULTY OF ENGINEERING TECHNOLOGY BNJ 30302 4. Identify and fill in the value of working and file registers after each instruction in Table 1 below for the PIC 16F84 Instructions Table 1 No. Before Instruction After Assume C-'0 0Ch = (20 marks) 5. Complete the assembly language below by fill in a comment for each instruction Start main loop resetCLRF 06 start BTFSS 05, 0 GOTO BTFSC 05, 01 GOTO start reset INCF 06 MOVLW OFF CALL delay GOTO END start (10 marks) 3

Explanation / Answer

Sl No

Before

Instruction

After

1.

W= 36    OEh =FE

MOVWF 0E

W= 36    0Eh = 36

2.

0Dh = 7A , 0Eh = 36

Dec 0D

0Dh = 79       0Eh =36

3.

W= FE     0Eh= FE

MOVLW 0E

W = 0E          0EH = 36

4.

0Dh = 7A , 0Eh = 36

RRF 0D

ASSUME C=0

0D=3D 0E=36

5.

0Dh =BB , 0Eh = 36

BCF 0D, 04

0D= AB       0E=36

6.

0Ch = 48 , W = 36

ADDWF 0C,W

0C= 7E         W=36

7.

0Ch = 16 , W = 37

SUBLW 53

0C= 16         W=1C

8.

0Ch = 14 , W = 36

ANDWF 0C

0C=    14      W=14

9.

0Ch = 14 , W = 36

IORWF 0C,W

0C= 14        W=36

10.

0Ch = 14 , W = 38

XORWF 0C,W

0C=14          W=2C

reset     CLRF 06                                 ; Clear the contents of the 0x05h

start      BTFSS 05, 0                          ;check bit 0 in 0x05 register is

               GOTO reset                         ;if bit was 0 then jump to label reset and execute the program from reset

BTFSC 05,01                        ; check bit 1 in 0x05 register

GOTO start                         ;if bit is 1 then jump to label start and execute the program from start

INCF 06                                ; increment the contents of register 0x06 by 1

MOVLW 0FF                       ; a hexadecimal value 0ff is loaded in W register

CALL delay                          ; push the content of

GOTO start                         ; jump to start and repeat

END

Sl No

Before

Instruction

After

1.

W= 36    OEh =FE

MOVWF 0E

W= 36    0Eh = 36

2.

0Dh = 7A , 0Eh = 36

Dec 0D

0Dh = 79       0Eh =36

3.

W= FE     0Eh= FE

MOVLW 0E

W = 0E          0EH = 36

4.

0Dh = 7A , 0Eh = 36

RRF 0D

ASSUME C=0

0D=3D 0E=36

5.

0Dh =BB , 0Eh = 36

BCF 0D, 04

0D= AB       0E=36

6.

0Ch = 48 , W = 36

ADDWF 0C,W

0C= 7E         W=36

7.

0Ch = 16 , W = 37

SUBLW 53

0C= 16         W=1C

8.

0Ch = 14 , W = 36

ANDWF 0C

0C=    14      W=14

9.

0Ch = 14 , W = 36

IORWF 0C,W

0C= 14        W=36

10.

0Ch = 14 , W = 38

XORWF 0C,W

0C=14          W=2C

Hire Me For All Your Tutoring Needs
Integrity-first tutoring: clear explanations, guidance, and feedback.
Drop an Email at
drjack9650@gmail.com
Chat Now And Get Quote