Question: I need help programming this code in C++ ASSEMBLY LANGUAGE . I need help ASAP. Thank you. By Assembly Language, I mean this following format:

I need help programming this code in C++ ASSEMBLY LANGUAGE. I need help ASAP. Thank you.

By Assembly Language, I mean this following format:

#include

using namespace std;

//any voids

void ...()

{

}

// any varibles

int/short variable_n

int main ()

{

_asm

{

... Assembly Code

}

}

I can NOT use a for, while, do-while loop nor can I use if-else statements. I must use the asm format above.

1. In front of Hilton hotel, there are 16 sprinkles. Each bits of the ax register represent one of the sprinklers. The first 8 bits of ax register represent the sprinklers watering the left side and the last 8 bits represent sprinklers watering the right side of the hotel.

If the content of the ax register is 0xF47E at this time, determine how many sprinklers are watering each side of the building?

Sample output

Content of ax register = 1111 0100 0111 1110

Number of sprinklers watering left side = 6

Number of sprinklers watering right side = 5

2.

Suppose the operating system is using the bx register to store the following information

bx:

Bit#

16

15

14

13

12

11

10

9

8

7

6

5

4

3

2

1

1

1

0

0

1

1

0

0

1

1

0

0

0

0

1

0

Bits 16,15,14 together are number of printers connected to the computer (110=6)

Bits 12,11 together are the number of disk drives connected to the computer (11=3)

Bits 9,8,7 together are the size of memory (001=1G, 010=2G,011=3G, ,111=7G)

Bits 2,1 together are the number of terminals connected to the system (00=none, 01=1,10=2,11=3)

Us the content of the bx register to display the above information

Sample output:

Content of bx = 1100 1100 1100 0010

Number of printers are 6

Number of disk drives are 3

Memory size is 3G

Number of terminals are 2

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!