Question: Using the ROL and ROR instructions, write a program to produce a rolling table. This table should be built from a single int 8 value

Using the ROL and ROR instructions, write a program to produce a rolling table. This table should be built from a single int8 value provided by the user and print 5 rows and 4 columns based upon the starting value. The first row should have four values beginning with the starting value, with each additional value offset by one from the starting value. In the second row, the values from the first row should be doubled by ROL'ed each one. In the third row, the values from the first row should be halved by ROR'ed each one. Then another row of ROL'ed values ending with a row of ROR'ed values, as shown below. For example, the following output should be produced when the user inputs the starting value 4:
Gimme a starting value: 4
Rolling Down Table
4:5:6:7:
8101214
2233
16202428
1111
For example, the following output should be produced when the user inputs the starting value 12:
Gimme a starting value: 12
Rolling Down Table
12:13:14:15:
24262830
6677
48525660
3333

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 Programming Questions!