4. [20 Points] Write a subroutine that multiplies the top nibble and the bottom nibble of...
Fantastic news! We've Found the answer you've been seeking!
Question:
Transcribed Image Text:
4. [20 Points] Write a subroutine that multiplies the top nibble and the bottom nibble of a number in W and returns the result in W. The setup and call of the subroutine are below. Fill in the details between the label Mult_nybbles and the RETURN instruction. Keep your routine less than about 20 instructions, but use any algorithm you like. Hint 1: Split the nybbles into two different registers using ANDWF with a bit mask. Hint 2: keep it simple - remember what you did in grade school. Hint 3: there are more than on solution, if it gets the job done within the about 20 instructions... (feel free to use back of page, but please mark clearly that you have). ; Variable declarations VarA VarB VarC Index EQU H' 20' ; Use these as you wish! EQU H'21' EQU H' 22' EQU H' 23' Constants (for testing) NybbleA EQU H'3' NybbleB EQU H'7' ; Start of code Load_W MOVLW NybbleA Put 0x3 into VarA was MOVWF VarA SWAPF ADDLW VarA, W NybbleB CALL Mult_nybbles MOVWF VarC Mult_nybbles; Write your code below ; Should be NybbleA* NybbleB (0x15) Cero.com 4. [20 Points] Write a subroutine that multiplies the top nibble and the bottom nibble of a number in W and returns the result in W. The setup and call of the subroutine are below. Fill in the details between the label Mult_nybbles and the RETURN instruction. Keep your routine less than about 20 instructions, but use any algorithm you like. Hint 1: Split the nybbles into two different registers using ANDWF with a bit mask. Hint 2: keep it simple - remember what you did in grade school. Hint 3: there are more than on solution, if it gets the job done within the about 20 instructions... (feel free to use back of page, but please mark clearly that you have). ; Variable declarations VarA VarB VarC Index EQU H' 20' ; Use these as you wish! EQU H'21' EQU H' 22' EQU H' 23' Constants (for testing) NybbleA EQU H'3' NybbleB EQU H'7' ; Start of code Load_W MOVLW NybbleA Put 0x3 into VarA was MOVWF VarA SWAPF ADDLW VarA, W NybbleB CALL Mult_nybbles MOVWF VarC Mult_nybbles; Write your code below ; Should be NybbleA* NybbleB (0x15) Cero.com
Expert Answer:
Related Book For
Income Tax Fundamentals 2013
ISBN: 9781285586618
31st Edition
Authors: Gerald E. Whittenburg, Martha Altus Buller, Steven L Gill
Posted Date:
Students also viewed these programming questions
-
"internet radios" for streaming audio, and personal video recorders and players. Describe design and evaluation processes that could be used by a start-up company to improve the usability of such...
-
Planning is one of the most important management functions in any business. A front office managers first step in planning should involve determine the departments goals. Planning also includes...
-
At Acme Corp., the firm's senior managers approach marketing implementation with the belief that marketing strategy should be developed at the top of the organization and then transmitted to lower...
-
Jasper Sports Limited purchased inventory costing $10,000 by signing a 10% short-term note payable. The purchase occurred on March 31, 2014. Jasper pays annual interest each year on March 31....
-
Leon's Furniture Ltd. is one of Canada's largest retailers, selling a wide range of merchandise, including furniture, major appliances, and home electronics. A recent statement of financial position...
-
10.A company contracted with a marketing firm to construct software and create a business website. A quote was requested and accepted. Sometime later, the business asked for updates and revisions but...
-
Recognition of Profit on Long-Term Contract Shanahan Construction Company has entered into a contract beginning January 1, 2010, to build a parking complex. It has been estimated that the complex...
-
A summary of two stocks is shown. 52W high 52W low Name of Stock Symbol High Low Close 37.18 29.39 Zycodec ZYO 11.76 7.89 Unix Co UNX 39.06 32.73 34.95 16.12 12.11 15.78 Last year, a stockholder...
-
Prepare a purchases return (journal) book from the following transactions for April 2017. 2017 April 05 10 17 28 Returned goods to M/s Kartik Traders Goods returned to Sahil Pvt. Ltd. Goods returned...
-
Let {xn} be a sequence converging to LE R. By the definition of convergence (no limit laws) prove limn ^2 x n = L^2
-
What is the importance of standardization of Medical Technology/Medical Laboratory Science Education among all Higher Education Institutions?
-
1. (4) A blood pressure of 110 mm Hg is measured using a cuff over the wrist which is positioned 30 cm above heart level. According to Bernoulli's equation(given below), what is the blood pressure at...
-
Paolo Corp generated the following income/(loss) since it's inception in 2017: Year Income/(loss) 2017 (5,000) 2018 7,000 2019 14,000 2020 (20,000) If Paolo generates $4,000 of income in 2021, what...
-
Explain the purpose of the following types of documents commonly used in property law and conveyancing. ? a. Title deeds b. Leases c. Mortgage documents
-
In what circumstances will div 7A of pt III ITAA36 deem a private company to pay a dividend? This is under Australian law.
-
What is your expected value for a game where your probability of winning is 1/9 and your profit is four times your wager?
-
-x/2 x/4 If A = -x/2 and A-1 =6 then x equals
-
Linda and Richard are married and file a joint return for 2012. During the year, Linda, who works as an accountant for a national airline, used $2,100 worth of free passes for travel on the airline;...
-
Jason and Mary Wells, friends of yours, were married on December 30, 2012. They know you are studying taxes and have come to you with a question concerning their filing status. Jason and Mary would...
-
Calculate the amount of the child and dependent care credit allowed for 2012 in each of the following cases, assuming the taxpayers had no income other than the stated amounts. a. William and Carla...
-
Construct a frequency and relative frequency histogram of the five-year rate of- return data discussed in Example 3. Approach To draw the frequency histogram, use the frequency distribution in Table...
-
Construct a frequency and relative frequency histogram of the five-year rate of- return data discussed in Example 3. Approach We will use StatCrunch to construct the frequency and relative frequency...
-
The data in Table 14 represent the two-year average percentage of persons living in poverty, by state, for the years 20122013. Draw a stem-and-leaf plot of the data. Approach Step 1 Treat the integer...
Study smarter with the SolutionInn App