Question

Microprocessors 1

Part I (15 points): Conditional Execution using Bit Test (btfsc/btfsc) 1) Explain, which is the operation of following code?

0 0
Add a comment Improve this question Transcribed image text
Answer #1

Answer:- Dear student, the code is a little bit confusing. First of all, after Ltop, BTFSC should be used. BTFSC will skip the next instruction i.e. "GOTO loc_lsb_is_1" only when LSB of the variable "loc" is zero. If LSB in "loc" is 1 then the next instruction must be executed.

Also, if LSB is zero then after sending 4, 3 and 2 to variable "out" we must use "GOTO Ltop" so that code will not execute for LSB = 1 part which sends 1, 6, 5 and 8 to "out" variable.

The overall idea of the code is-

  1. define two variables loc and out at address 0x00 and 0x01
  2. make the value of loc as 1
  3. then check LSB of loc if this is 1, make the value of out as 4 then 3 and then 2.
  4. if LSB is zero, make the value of out as 1 then 6 then 5 and then 8
  5. do steps 3 and 4 infinitely.

Dear student, please comment if you have any further doubt. Thank you

Add a comment
Know the answer?
Add Answer to:
Microprocessors 1 Part I (15 points): Conditional Execution using Bit Test (btfsc/btfsc) 1) Explain, which is...
Your Answer:

Post as a guest

Your Name:

What's your source?

Earn Coins

Coins can be redeemed for fabulous gifts.

Not the answer you're looking for? Ask your own homework help question. Our experts will answer your question WITHIN MINUTES for Free.
Similar Homework Help Questions
  • Consider the following assembly language code. The clock frequency is 4 MHz- and all initialization steps...

    Consider the following assembly language code. The clock frequency is 4 MHz- and all initialization steps have been done correctly (like setting up digital I/O, the oscillator configuration, etc.) Constants Bit Pattern EQU H'20' LoopCtr EQU H'21' Max Count EQU .23; Main program loop MainLoop CLRF BitPattern CALL Output BSF BitPattern, 1 CALL Output RRF BitPattern CALL Output BSF BitPattern, 1 CALL Output GOTO MainLoop Output MOVF BitPattern, W MOVWF PORTB MOVLW MaxCount MOVWF LoopCtr Loop NOP DECFSZ LoopCtr GOTO...

  • Write a PIC18Fxx2 assembly program that takes the variable A and save into B in inverted the 110010102, then the program finishes with B 010100112-The 1. bit order. For example, if A variable A s...

    Write a PIC18Fxx2 assembly program that takes the variable A and save into B in inverted the 110010102, then the program finishes with B 010100112-The 1. bit order. For example, if A variable A shall preserve the original value at the end of the program execution. The program shall be implemented using any of the loop and shift techniques discussed in class. 2. Write a PIC18Fxx2 assembly program that makes the calculus of the first eigth (8) terms of the...

  • Fill in the blank using the word from below 1   A common way to detect whether...

    Fill in the blank using the word from below 1   A common way to detect whether a value is even or odd is to use the ___________ operation to test if the least significant bit is set. 2    In order to implement branching in an Assembly program, you must use ___________ to identify blocks of code. 3    The ___________ instruction will move execution to a different section of code regardless of any conditions. 4    Before any conditional tests can be...

  • #include <iostream> #include <iomanip> #include <vector> using namespace std; Part 1. [30 points] In this part,...

    #include <iostream> #include <iomanip> #include <vector> using namespace std; Part 1. [30 points] In this part, your program loads a vending machine serving cold drinks. You start with many foods, some are drinks. Your code loads a vending machine from foods, or, it uses water as a default drink. Create class Drink, make an array of drinks, load it and display it. Part 1 steps: [5 points] Create a class called Drink that contains information about a single drink. Provide...

  • I posted this question earlier but realized that the code was not easy to test since...

    I posted this question earlier but realized that the code was not easy to test since it was just screenshots and not text so I am reposting it: I'm very new at working with file streams, and I'm having trouble with a HW assignment I have to work on. For the assignment I have to read an input file named "MagicSquaresIn.txt" (included at the bottom) and I have to check whether they are normal, associative, and panmagic. To check that...

  • Here is the code I made, but the test case is not working, it goes wrong...

    Here is the code I made, but the test case is not working, it goes wrong when the binary string convert to decimal. please help. #include "stdafx.h" #include <iostream> #include <string> #include <math.h> #include <locale> using namespace std; // function for option 1 void decToBin(int number) {        int array[16];        int i = 0;        for (int counter = 0; counter < 16; counter++)        {               array[counter] = 0;        }        while (number > 0)        {...

  • This project is divided into 3 parts: Part 1. Create a new project and download the arrayList and...

    This project is divided into 3 parts: Part 1. Create a new project and download the arrayList and unorderedArrayList templates that are attached. Create a header file for your unorderedSet template and add it to the project. An implementation file will not be needed since the the new class will be a template. Override the definitions of insertAt, insertEnd, and replaceAt in the unorderedSet template definition. Implement the template member functions so that all they do is verify that the...

  • Instructions Using the BCException.java and the BankCustomer.java from the first part of the assignment you will...

    Instructions Using the BCException.java and the BankCustomer.java from the first part of the assignment you will implement a driver class called Bank.java to manipulate an ArrayList of BankCustomer objects. Your code should read bank customers’ information from the user. It will then create a bank customer objects and add them to an arraylist in a sorted fashion (sorted by account number). The arraylist should be sorted in ascending order at all times. The arraylist should not contain null objects at...

  • Question 1 Not yet answered Marked out of 1.00 Flag question Question text Which of the...

    Question 1 Not yet answered Marked out of 1.00 Flag question Question text Which of the following keywords is useful for skipping to the next iteration of a loop? Select one: a. do b. break c. switch d. continue e. while Clear my choice Question 2 Not yet answered Marked out of 1.00 Flag question Question text Consider the following line of Java code. System.out.println("Hello, World!"); "out" is which of the following? Select one: a. a statement b. a class...

  • ASSIGNMENT INFO Lab 10 Lab 10 / 1. Problem 1 saved 3 points possible Reset to...

    ASSIGNMENT INFO Lab 10 Lab 10 / 1. Problem 1 saved 3 points possible Reset to Starter Code Due in 2h 29m Instructions Start Here Question 1 Saved Coding Problem, 3 points possible Write a program that has a static method called shares that takes in two arraylists and returns a new arraylist that contains the words that are common to both arraylists - do not include duplicates! Write this as a static method in the same program as your...

ADVERTISEMENT
Free Homework Help App
Download From Google Play
Scan Your Homework
to Get Instant Free Answers
Need Online Homework Help?
Ask a Question
Get Answers For Free
Most questions answered within 3 hours.
ADVERTISEMENT
ADVERTISEMENT
ADVERTISEMENT