Consider a computer with a bit field instruction of the form BFFFO R1,(R2),{R3:R4} that locates the first bit set to one in the specified bit field. After this instruction has been executed, register R1 contains the position of the first bit set to one, or the length of the bit field, if the bit field is all zeros. Register R2 contains the address of a word in memory, register R3 contains the offset of the bit field from the word pointed at by R2, and R4 contains the width of the bit field from 1 to 32 (empty bit fields are not supported).

What will be an ideal response?


Consider a computer with a bit field instruction of the form BFFFO R1,(R2),{R3:R4} that locates the first
bit set to one in the specified bit field. After this instruction has been executed, register R1 contains the position
of the first bit set to one, or the length of the bit field, if the bit field is all zeros. Register R2 contains the
address of a word in memory, register R3 contains the offset of the bit field from the word pointed at by R2,
and R4 contains the width of the bit field from 1 to 32 (empty bit fields are not supported).

Consider a computer with a bit field instruction of the form BFFFO R1,(R2),{R3:R4} that locates the first
bit set to one in the specified bit field. After this instruction has been executed, register R1 contains the position
of the first bit set to one, or the length of the bit field, if the bit field is all zeros. Register R2 contains the
address of a word in memory, register R3 contains the offset of the bit field from the word pointed at by R2,
and R4 contains the width of the bit field from 1 to 32 (empty bit fields are not supported).


Set counter to zero
Repeat Shift bit field left
If carry out 1 then exit
If carry out not 1 then increment 1s count
End repeat


There is a flaw in this code if you allow the bit field offset to be any number (i.e., the bit field is not confined to
the word loaded. In this case, you would have to take the bit field offset, divide it by 32 (the length of a word)
and add that integer to the base address to get the address of the word where the bit field starts. Moreover, if
the bit field and remaining offset are greater than 32, you would have to read part of the bit field from the
current address and the rest from the following address.

Computer Science & Information Technology

You might also like to view...

Which of the following statements calls function abc?

a. call abc; b. abc; c. p = abc(q); d. void abc(void); e. none of the above

Computer Science & Information Technology

A 4XSLT _________ object transforms XML into HTML, by applying a specified XSLT style sheet.

Fill in the blank(s) with the appropriate word(s).

Computer Science & Information Technology

The feature that automatically moves words to the beginning of the next line if they do not fit is called ________

Fill in the blank(s) with correct word

Computer Science & Information Technology

A breach at a credit card company resulted in customers credit card information being exposed . The company has conducted a full forensic investigation and identified the source of the breach. Which of the following should the company do NEXT?

A. Move to the incident identification phase B. Implement the risk assessment plan C. Implement damage and loss control procedures D. Implement first responder processes

Computer Science & Information Technology