CopyBits(x,p,n,y)
copy n LSBs from y to x starting LSB at 'p'th position.
Answer Posted / rakesh
It should be p--, not p++. for example y = 217 (11011001)
and you want to extract the least 4 SB then n = 4 and p = 3
(remember the number start from 0 to 7 in memory). After
executing this you will get x = 9 i.e 1001.
t=0;
for(i=n; i>0; i--)
{
t |= (1<<p);
p--;
}
x=x&~t;
t=t&y;
x=x|t;
| Is This Answer Correct ? | 0 Yes | 0 No |
Post New Answer View All Answers
What is the collection of communication lines and routers called?
What is c programing language?
How do you construct an increment statement or decrement statement in C?
What is file in c language?
Write a C program to help a HiFi’s Restaurant automate its breakfast billing system. Your assignment should implement the following items: a. Show the customer the different breakfast items offered by the HiFi’s Restaurant. b. Allow the customer to select more than one item from the menu. c. Calculate and print the bill to the customer. d. Produce a report to present your complete program and show more sample output. Assume that the HiFi’s Restaurant offers the following breakfast menu: Plain Egg $2.50 Bacon and Egg $3.45 Muffin $2.20 French Toast $2.95 Fruit Basket $3.45 Cereal $0.70 Coffee $1.50 Tea $1.80
What does it mean when the linker says that _end is undefined?
how to solve "unable to open stdio.h and conio.h header files in windows 7 by using Dos-box software
How can I read data from data files with particular formats?
In c programming language, how many parameters can be passed to a function ?
What is the time and space complexities of merge sort and when is it preferred over quick sort?
Is malloc memset faster than calloc?
Explain is it better to use a pointer to navigate an array of values, or is it better to use a subscripted array name?
What is the difference between a function and a method in c?
Why c is a mother language?
Define and explain about ! Operator?