Question: Microprocessors Class Conditional Execution using Bit Test ( btfsc ). Explain, which is the operation of following code? Which is the output of the code?

Microprocessors Class

Conditional Execution using Bit Test (btfsc).

Explain, which is the operation of following code? Which is the output of the code?

INCLUDE "P18F242.INC"

CBLOCK 0x0

loc,out

ENDC

org 0

goto main

org 0x0200

main

;movlw 0

movlw 1

movwf loc

Ltop

btfsc loc,0

goto loc_lsb_is_1

movlw 4

movwf out

movlw 2

movwf out

movlw 3

movwf out

loc_lsb_is_1

movlw 1

movwf out

movlw 6

movwf out

movlw 5

movwf out

movlw 8

movwf out

goto Ltop ; loop forever

end

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!