You are on page 1of 1

PAF – Karachi Institute of Economics and Technology

(Dept. of EE)

Course: Embedded System Design


Faculty: Engr. Kamran Ali Khan
CID – Sem: 106911 - Spring 2021
Exam: Quiz 5

Points: 10 Time: 30 minutes

Q. The PIC 18F452 code snippet, given below, is written to get the status of an ACTIVE HIGH
switch, connected to the MSB of Port B and send it to an LED connected to the LSB of the same
port. The anode of the LED is connected to the Vcc. The LED turns ON when the switch is
PRESSED.

BSF TRISB, 7
BCF TRISB, 0
AGAIN
BTFSC PORTB, 7
GOTO OVER
BSF PORTB, 0
GOTO AGAIN
OVER
BCF PORTB, 0
GOTO AGAIN

Re-write the above code with answers for each of the BLACK BOXES on your
answer script.

[(CLO_4) (Cognitive Level C1 – Understanding & Knowledge) (PLO_2, i.e., Problem Analysis)]

Brain Storm!

PAF – KIET 1

You might also like