Write an HLA Assembly program that prompts for an int8 value to inspect and then prints...
Fantastic news! We've Found the answer you've been seeking!
Question:
Transcribed Image Text:
Write an HLA Assembly program that prompts for an int8 value to inspect and then prints it in binary format. For example, here would be the program output for various entered values Gimme a decimal value to print: 15 15 is 0000 1111 Gimme a decimal value to print: 7 7 is 0000 0111 (Hint: There is no standard output that prints in binary output, so you need to do this yourself. In order to accomplish this, you need to move a bit at time into the carry flag and print 0 or 1, depending on what you find in the Carry bit. Shift and repeat this procedure 8 times and you are done! Eventually, we will learn how to loop, which wodid make this task much less terrible.) (Second Hint:LAHF pushes the Carry Bit and all the other flags out of the EFLAGS register and into AH. As an Assembly programmer, you have the power to mask out all the bits but the one you are interested in by using either AND or OR.) PROGRAM 4: Double Table Using the ROL instruction to perform multiplication, write a program to produce a double table. This table should be built from a single int8 value provided by the user and print 4 rows from the starting value, each offset by one from the starting value. In that column, the pattern of doubled numbers should be calculated by ROL instructions. For example, the following output should be produced when the user inputs the starting value 4: Gimme a starting value: 4 Double Table 4: 81632 S: 10 20 40 6: 12 24 48 7: 14 28 56 For example, the following output should be produced when the user inputs the starting value 7: Gimme a starting value: 7 Double Table Gimme a decimal value to print: 7 7 is 0000_0111 (Hint: There is no standard output that prints in binary output, so you need to do this yourself. In order to accomplish this, you need to move a bit at time into the carry flag and print 0 or 1, depending on what you find in the Carry bit. Shift and repeat this procedure 8 times and you are done! Eventually, we will learn how to loop, which would make this task much less terrible.) (Second Hint:LAHF pushes the Carry Bit and all the other flags out of the EFLAGS register and into AH. As an Assembly programmer, you have the power to mask out all the bits but the one you are interested in by using either AND or OR.) PROGRAM 4: Double Table Using the ROL instruction to perform multiplication, write a program to produce a double table. This table should be built from a single int8 value provided by the user and print 4 rows from the starting value, each offset by one from the starting value. In that column, the pattern of doubled numbers should be calculated by ROL instructions. For example, the following output should be produced when the user inputs the starting value 4: Gimme a starting value: 4 Double Table 4: 8 16 32 5: 10 20 40 6: 12 24 48 7: 14 28 56 For example, the following output should be produced when the user inputs the starting value 7: Gimme a starting value: 7 Double Table 7: 14 28 56 8: 16 32 64 9: 18 36 72 10: 20 40 80 8:10 Back referenceguideii.htm Programmer's Reference to HLA Assembly Language Typical Program Structure program progID; #include "stdlib.hhf" ); static variable declarations begin progID; statements end progID; Assembly Language Instructions Instruction Syntax Description mov ( dest- MOV source, source; dest); Jadd ( ADD source, dest ); sub ( dest + source; dest- SUB SHL source, source: dest ); shl ( count, deat ); shuffles left a total of count bits Available Datatypes in dest int8 operand; int16 sets carry int32 when count-1 boolean shuffles right a total of count bits SHR shr ( count, in dest dest); operand; sets carry Available 1/0 Routines when count-1 stdout.put shuffles stdout.puti8 right a stdout.puti16 total of stdout.puti32 count bits stdout.putb in dest stdout.putw SAR sar ( count, operand; stdout.putd sets carry dest ); stdout.newIn when count-1; leaves H.O.stdin.get bit unchanged stdin.geti8 stdin.geti16 stdin.qeti32 Write an HLA Assembly program that prompts for an int8 value to inspect and then prints it in binary format. For example, here would be the program output for various entered values Gimme a decimal value to print: 15 15 is 0000 1111 Gimme a decimal value to print: 7 7 is 0000 0111 (Hint: There is no standard output that prints in binary output, so you need to do this yourself. In order to accomplish this, you need to move a bit at time into the carry flag and print 0 or 1, depending on what you find in the Carry bit. Shift and repeat this procedure 8 times and you are done! Eventually, we will learn how to loop, which wodid make this task much less terrible.) (Second Hint:LAHF pushes the Carry Bit and all the other flags out of the EFLAGS register and into AH. As an Assembly programmer, you have the power to mask out all the bits but the one you are interested in by using either AND or OR.) PROGRAM 4: Double Table Using the ROL instruction to perform multiplication, write a program to produce a double table. This table should be built from a single int8 value provided by the user and print 4 rows from the starting value, each offset by one from the starting value. In that column, the pattern of doubled numbers should be calculated by ROL instructions. For example, the following output should be produced when the user inputs the starting value 4: Gimme a starting value: 4 Double Table 4: 81632 S: 10 20 40 6: 12 24 48 7: 14 28 56 For example, the following output should be produced when the user inputs the starting value 7: Gimme a starting value: 7 Double Table Gimme a decimal value to print: 7 7 is 0000_0111 (Hint: There is no standard output that prints in binary output, so you need to do this yourself. In order to accomplish this, you need to move a bit at time into the carry flag and print 0 or 1, depending on what you find in the Carry bit. Shift and repeat this procedure 8 times and you are done! Eventually, we will learn how to loop, which would make this task much less terrible.) (Second Hint:LAHF pushes the Carry Bit and all the other flags out of the EFLAGS register and into AH. As an Assembly programmer, you have the power to mask out all the bits but the one you are interested in by using either AND or OR.) PROGRAM 4: Double Table Using the ROL instruction to perform multiplication, write a program to produce a double table. This table should be built from a single int8 value provided by the user and print 4 rows from the starting value, each offset by one from the starting value. In that column, the pattern of doubled numbers should be calculated by ROL instructions. For example, the following output should be produced when the user inputs the starting value 4: Gimme a starting value: 4 Double Table 4: 8 16 32 5: 10 20 40 6: 12 24 48 7: 14 28 56 For example, the following output should be produced when the user inputs the starting value 7: Gimme a starting value: 7 Double Table 7: 14 28 56 8: 16 32 64 9: 18 36 72 10: 20 40 80 8:10 Back referenceguideii.htm Programmer's Reference to HLA Assembly Language Typical Program Structure program progID; #include "stdlib.hhf" ); static variable declarations begin progID; statements end progID; Assembly Language Instructions Instruction Syntax Description mov ( dest- MOV source, source; dest); Jadd ( ADD source, dest ); sub ( dest + source; dest- SUB SHL source, source: dest ); shl ( count, deat ); shuffles left a total of count bits Available Datatypes in dest int8 operand; int16 sets carry int32 when count-1 boolean shuffles right a total of count bits SHR shr ( count, in dest dest); operand; sets carry Available 1/0 Routines when count-1 stdout.put shuffles stdout.puti8 right a stdout.puti16 total of stdout.puti32 count bits stdout.putb in dest stdout.putw SAR sar ( count, operand; stdout.putd sets carry dest ); stdout.newIn when count-1; leaves H.O.stdin.get bit unchanged stdin.geti8 stdin.geti16 stdin.qeti32
Expert Answer:
Answer rating: 100% (QA)
Here is a program in x86 assembly language that implements the double table as described in the ques... View the full answer
Related Book For
Operations Management A Supply Chain Process Approach
ISBN: 978-1483383064
1st edition
Authors: Joel D. Wisner
Posted Date:
Students also viewed these programming questions
-
can someone solve this Modern workstations typically have memory systems that incorporate two or three levels of caching. Explain why they are designed like this. [4 marks] In order to investigate...
-
In Problems 23 34, graph each system of linear inequalities. x - 2y 6 2x - 4y 0
-
A number of economists contend that official measures of U.S. gross private investment expenditures are understated. For instance, household spending on education, such as college tuition...
-
Maynard Steel plans to pay a dividend of $3 this year. The company has an expected earnings growth rate of 4% per year and an equity cost of capital of 10%. a. Assuming that Maynards dividend payout...
-
In the organizational chart for the consumer-packaged goods firm in Figure 22 5, where do product line, functional, and geographical groupings occur? Figure 22-5 Chief Marketing Officer or Vice...
-
Brian Smith, network administrator at Advanced Energy Technology (AET), was given the responsibility of implementing the migration of a large data center to a new office location. Careful planning...
-
While many parties were interested in acquiring MCI, the major players included Verizon and Qwest. U.S.-based Qwest is an integrated communications company that provides data, multimedia, and...
-
a. Prepare a UML class diagram with classes, associations, and multiplicities. b. Using the preceding information and the following attributes list, prepare a listing of the relational tables...
-
Graph the solution set of each system of inequalities: (x+y6 y4 4. y-x>-2 x>1 6. y 21 5. (ys x +4) y > x y>-3x-5 7. x + 2y 8 (3x + 2y 18 y2 x20 (2x-y-20 8. x>5 y > 2 x + 2y > 6 y-x <1 For #8, also...
-
Can you elucidate the impact of quantitative easing policies on the interest rate risk profiles of investment banks?
-
You have now selected a product segment. Please conduct a geographic analysis to determine the ideal country for expansion. This analysis should consider the compound annual growth rate (CAGR) of the...
-
Does Emily have to complete form T1135 to report her USA bank account she received as an inheritance and if so what amount does she report?
-
What are two RHIOs? Describe each briefly and their stakeholders. Compare their functionalities and services to members. Which administrative, technical, and financial challenges or any other...
-
A 3-phase turbine-generator is operated at 6.6 MW, 0.85 power factor lagging. Determine the apparent impedance in pu measured at its terminal looking towards the generator step-up transformer. The...
-
Discuss Interest Rates in detail.
-
Evenflow Power Co. is considering a new project that is a little riskier than the current operations of the company. Thus, management has decided to add an additional 1.5% to the company's overall...
-
A listing of deliveries to be completed for the day are shown below. Assuming that the customers are ranked in proximity to one another (i.e., customer 4 is closer to customer 3 than customer 5 is),...
-
A parts supplier has three industrial customers located southern California. They wish to build a centralized distribution center to serve the three customers. The locations of the customers and...
-
Compare telemarketing to the use of field sales personnel for relationship management purposes.
-
What is likely to be the impact of rising levels of intra-regional trade for the world economy?
-
Why doesnt the USA specialise as much as General Motors or Texaco? Why doesnt the UK specialise as much as Unilever? Is the answer to these questions similar to the answer to the questions, Why...
-
It is often argued that if the market fails to develop infant industries, then this is an argument for government intervention, but not necessarily in the form of restricting imports. In what other...
An Introduction To Exterior Electrical Power Distribution 1st Edition - ISBN: 1492861472 - Free Book
Study smarter with the SolutionInn App