• Computer Programming
  • C Programming
  • Intel 8085

What are register variables What are the advantage of using register variables?

User Avatar

Wiki User

βˆ™ 2009-02-17 06:33:14

Best Answer

Asks the compiler to devote a processor register to this variable in order to speed the program's execution. The compiler may not comply and the variable looses it contents and identity when the function it which it is defined terminates.

2009-02-17 06:33:14
This answer is:
User Avatar

Your Answer


Related Questions

Advantage of using a CPU register over memory locations?

CPU register is faster than memory loacations

What is the advantage of swapping two variables without using 3 variable?

Nothing. Never do that.

What are register variables?

A register variables is that which got space in CPU internal register sets this requst can be granted or rejected by CPU ,by register veriable the processing speed become much faster for that variable.

What is the scope of register variables?

The block they are declared in.

What are Advantages to Correlation study?

An advantage of using a correlational study is that it allows you to investigate variables that cannot be directly manipulated.

What is the advantage of using a CPU register for temporary data storage over using a memory location?

Simple answer - speed. By using the CPU register, the information is kept "local" to the CPU. By storing a value in a memory location, a lookup has to be performed to retrieve it.

What are the advantage of using pointer in a program?

pointers points to the memory address of another functions we have two kind of variables the actual and dummy variable. when we operate on variables..the value of dummy variables are effected, but if we want to make changes in the actual variable then we have to refer to their address..and we can reach to address of the variables by only using pointers.

Memory allocation of variables declared in a program is?

in register

Where do register variables get stored?

Either in registers or on the stack.

How do you identify the register variables?

Registry variables can be identified with registry allocation. The programmer will decide on the variables that need to be assigned to the registry, and variables not assigned to the registry will be held in RAM.

What is one advantage of using a variable to represent a pattern?

A single statement, using variables, can convey the same information as many, sometimes infinitely many, statements.

What is Advantages of register variables in C?

Faster execution of code.

What is register and advantages of register?

registers are a small high-speed memory inside CPU. one advantage of using them is increase in CPU speed because of their high access rate in comparison by ram.

What is register variable in c language?

Register variables are a special case of automatic variables. Automatic variables are allocated storage in the memory of the computer; however, for most computers, accessing data in memory is considerably slower than processing in the CPU. These computers often have small amounts of storage within the CPU itself where data can be stored and accessed quickly. These storage cells are called registers. Normally, the compiler determines what data is to be stored in the registers of the CPU at what times. However, the C language provides the storage class register so that the programmer can ``suggest'' to the compiler that particular automatic variables should be allocated to CPU registers, if possible. Thus, register variables provide a certain control over efficiency of program execution. Variables which are used repeatedly or whose access times are critical, may be declared to be of storage class register. Also these register variables are used in huge projects the tiny program developers are not interested to include these register variables, because the tiny programs never requires more time complete its job. These register variables may be used to store constant values so as to make use of it anywhere in the programs. main{ register float a=0;}

What is the Difference between auto and register storage classes in c language?

register behaves like auto class but auto variables are actually local variables.They are created when the functions are created but they are destroyed when the fns is exited.But register-variables are used to speed up the operations

Difference between register variable and automatic variables?

Register variables are stored in register of microprocessor/micro-controller. The read/write access to register variable is the fastest because CPU never need any memory BUS operation to access these variable. Auto variable are stored in stack thus access are much slower. Auto variable can be converted to register by using register keyword before it. It has platform specific limitation. Register variable will work only if free registers are available to hold the variable for a function scope. In case of Microprocessor or microcontrollers having very less number of general purpose registers will never take register variable even if we declare it as register.

How can you devise a way to interchange two variables A and B without using a third variable or register using Exclusive OR?

A = A xor B B = A xor B A = A xor B in C... A^=B; B^=A; A^=B;

Where does register variables get stored?

In registers. Or on the stack. It's up to the compiler to decide. (Nowadays we very rarely use the 'register' keyword.)

Where does global static local register variables free memory and C Program instructions get stored?

* These are all implementation defined. Access to `register' specified indentifiers should be as fast as possible, so the compiler may place the value in a machine register. However, the compiler is free to treat a `register' declaration as an `auto' declaration. * Where free memory is maintained is an OS specific concept. Instructions are generally stored in code segement. Local Variables are stored in Stack. Register variables are stored in Register. Global & static variables are stored in data segment. The memory created dynamically are stored in Heap And the C program instructions get stored in code segment.

What are the advantages of using global variables?

There are no advantages to using global variables. It makes it difficult to determine when and where changes are occurring to those variables and data races are unavoidable.

Where are global local static extern variables stored?

AnswerLocal Variables are stored in Stack. Register variables are stored in Register. Global variables are stored in data segment. The memory created dynamically are stored in Heap And the C program instructions get stored in code segment and the extern variables also stored in data segment. Nooo NoooStatic variable will be stored in .BSS segment... (Block Started By Symbol)

What is the storage allocation and scope of global extern static local and register variables?

Extern is not a storage allocation specifier, it declares external linkage. That is, the declared variable or constant will be defined in a separate translation unit. Variables declared in global scope are allocated in static memory, as are all constants and static local variables. Local (non-static) variables are allocated on the (current) call stack. In multi-threaded applications, each thread has its own call stack. Register variables are automatic variables allocated within a CPU register, however the language compiler ultimately decides when or indeed if this is appropriate.

In java all variables declared using a class are?

Reference variables

What are register variables in c?

A register specifier for a variable is a compiler hint that the variable is used often and should be kept in a CPU register. The compiler will treat the variable as automatic, but it will give it preference for staying in a register between sequence points.

Advantage of using template in an organization?

advantage of using template in an orgainsation