Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

There is an 8-bit register named CTRL at memory location 0x8000102C. It has the following bit values: Bit 7 6 5 4 3 2 1

  1. There is an 8-bit register named CTRL at memory location 0x8000102C. It has the following bit values:

Bit 7

6

5

4

3

2

1

0

EN

NEN

OPT

GX

FLG

WERR

  1. Write one line of code to read the value of CTRL into inval. Assume that the IDE works in such a way that you can simply do something like inval = CTRL.
  2. Write one line of code to mask inval so that only the FLG bit is reflected. That is, after masking, inval should be non-zero if FLG is 1 and zero if FLG is 0. Hint: The value of the control register is already in the variable named "inval". Apply a masking operation to "inval" so that all bits besides the FLG bit are forced to zero. (This results in a situation in which inval is non-zero if FLG=1 and inval is zero if FLG=0.)

  1. Write one line of code to set (force to 1) the NEN bit without affecting any other bits. One way to do this is to read CTRL into inval (do it again CTRL might have changed since the last time you did it), manipulate inval, and then write it back to CTRL.
  2. Write one line of code to clear (force to 0) the EN bit without affecting any other bits.

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image_2

Step: 3

blur-text-image_3

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Introductory Relational Database Design For Business With Microsoft Access

Authors: Jonathan Eckstein, Bonnie R. Schultz

1st Edition

1119329418, 978-1119329411

More Books

Students also viewed these Databases questions

Question

Describe forecasting requirements.

Answered: 1 week ago

Question

=+Where does the focus of labor relations lie? Is it collective

Answered: 1 week ago

Question

=+With whom does the firm have to negotiate?

Answered: 1 week ago