What happens when a computer program is executed?

1 Answer

Answer :

It depends upon the machine architecture and whether the programis encoded in native machine code or requires further translationto produce the required machine code.With native code, the operating system's program loadertypically decodes the executable, allocating separate memoryregions to cater for the program's text segment (the actual machinecode), the data segment (static memory) and a call-stack for themain thread (additional call-stacks are allocated at runtime as andwhen required by any additional threads). The data segment isdivided into two sections, an initialised section and anuninitialised section. The initialised section is usually stored asa bitmap within the executable file and is simply loaded directlyinto memory as-is. The uninitialised section makes up the remainderof static memory and is typically zero-initialised. The textsegment can refer to any value in the data segment using thevalue's offset memory address which was established at link time.Once the execution environment is fully established, control ispassed to the machine code which typically pushes the global mainfunction onto the call stack and passes control to the firstinstruction. When the global main function ends, the programterminates and all memory allocations are released, including allmemory allocated by the program at runtime.With non-native code, a runtime interpreter is required toperform the translation from the compiled or high-level source codeto native machine code. For instance, Java source code compiles toJava byte code which is suitable for interpretation by the Javavirtual machine (JVM). The JVM is a native machine code programlike any other and the JVM creates and manages the executionenvironment for the Java byte code.

Related questions

Description : ..... is a set of Keywords, s symbols, and a system of rules for constructing statements by which humans can communicate the instructions to be executed by a computer... 1) A Computer Program 2) A Programming Language 3) An Assembler 4) Syntax

Last Answer : 2) A Programming Language

Description : Process is ........................ A) A program in execution B) An instance of a program running on a computer. C) The entity that can be assigned to and executed D) All of the above.

Last Answer : D) All of the above.

Description : Suppose d = { john :40, peter :45}, what happens when we try to retrieve a value using the expression d[ susan ]? a) Since susan is not a value in the set, Python raises a KeyError ... Python raises a KeyError exception d) Since susan is not a key in the set, Python raises a syntax error

Last Answer : c) Since “susan” is not a key in the set, Python raises a KeyError exception

Description : What Happens When Hlt Instruction Is Executed In Processor?

Last Answer : Answer :The Micro Processor enters into Halt-State and the buses are tri-stated.

Description : If a={5,6,7}, what happens when a.add(5) is executed? a) a={5,5,6,7} b) a={5,6,7} c) Error as there is no add function for set data type d) Error as 5 already exists in the set

Last Answer : Answer: b Explanation: There exists add method for set data type. However 5 isn’t added again as set consists of only non-duplicate elements and 5 already exists in the set. Execute in python shell to verify.

Description : Explain the need to compile each time the program is executed. ?

Last Answer : Compile is required every time the program is executed. The compiler is more useful as a translator program. The compiler translates high-level language source programs into object programs. The compiler ... , the compiler is no longer needed. Displays any errors in the program on the monitor.

Description : Which register holds the current instruction to be executed. a. Instruction register b. Program register 9 Control register a None of these

Last Answer : a. Instruction register

Description : The register which keeps track of the execution of a program and which contains the memory address of the instruction currently being executed is known as: a) Index Register b) Memory Address Register c) Program Counter d) None of The Above

Last Answer : c) Program Counter

Description : Point out the wrong statement. a) In theory, any application can run either completely or partially in the cloud b) The location of an application or service plays a fundamental role in how the ... unit, under the control of an integrated program CSE-R17.BLOGSPOT.COM d) None of the mentioned

Last Answer : None of the mentioned

Description : In microprocessor the next instruction to be executed is stored in a) Program Counter b) Stack Pointer c) Memory Pointer d) Accumulator

Last Answer : Ans: Program Counter

Description : When the RET instruction at the end of subroutine is executed, a. the information where the stack is iniatialized is transferred to the stack pointer b. the memory address of the RET instruction is ... two data bytes stored in the top two locations of the stack are transferred to the stack pointer

Last Answer : c. two data bytes stored in the top two locations of the stack are transferred to the program counter

Description : Which of the following statements is true about a software verification and validation program? I. It strives to ensure that quality is built into software. II. It provides management with insights into the state ... software development activities. A. I, II&III B.II, III&IV C.I, II&IV D.I, III&IV

Last Answer : C.I, II&IV

Description : ……………. are not machine instructions and therefore, Java interpreter generates machine code that can be directly executed by the machine that is running the Java program. A) Compiled Instructions B) Compiled code C) byte code D) Java mid code

Last Answer : C) byte code

Description : A ………………… attaches itself to executable files and replicates, when the infected program is executed, by finding other executable files to infect. A) Stealth virus B) Polymorphic Virus C) Parasitic Virus

Last Answer : C) Parasitic Virus

Description : What will be the output at PORT1 if the following program is executed? MVI B, 82H MOV A, B MOV C, A MVI D, 37H OUT PORT1 HLT (A) 37H (B) 82H (C) B9H (D) 00H

Last Answer : Answer: B Explanation: In 8085 programming, the result of an operation is stored in the accumulator. So output is 82H.

Description : Suppose that the number of instructions executed between page faults is directly proportional to the number of page frames allocated to a program. If the available memory is doubled, the mean interval between page faults is also ... memory were available? (A) 60 sec (B) 30 sec (C) 45 sec (D) 10 sec

Last Answer : Answer: C Explanation: T = Ninstr x 1µs + 15,000 x 2,000 µs = 60s Ninstr x 1µs = 60,000,000 µs - 30,000,000 µs = 30,000,000 µs Ninstr = 30,000,000 The number of instruction ... doesn't mean that the program runs twice as fast as on the first system. Here, the performance increase is of 25%.

Description : When a program is being executed in an 8085 microprocessor, its Program Counter contains  (A) the number of instructions in the current program that have already been executed (B) the total number ... is being currently executed (D) the memory address of the instruction that is to be executed next

Last Answer : When a program is being executed in an 8085 microprocessor, its Program Counter contains the memory address of the instruction that is to be executed next

Description : What component of the computer keeps track of the address in memory of the programming instructions being executed?

Last Answer : The program counter.

Description : _______ is a programming language that is interpreted & executed directly by the computer: a) Machine Language b) Assembly Language c) HTML d) None of These

Last Answer : a) Machine Language

Description : When a computer is first turned on or restarted, a special type of absolute loader called____ is executed 1) Compile and Go loader 2) Boot loader 3) Bootstrap loader 4) Relating loader

Last Answer : 3) Bootstrap loader

Description : When a computer is first turned on or restarted, a special type of absolute loader called____ is executed 1 Compile and Go loader 2 Boot loader 3 Bootstrap loader 4 Relating loader

Last Answer : 3 Bootstrap loader

Description : What's the point of a California jury sentencing the Grim Sleeper to death when California hasn't executed anyone in 10 years?

Last Answer : answer:Waste of time and money to put him on Death Row. I say that as a California citizen. Life without Parole is a legal alternative in California. Should just go there without all the extra hoopla around the death penalty process.

Description : Why wasn't princess Leia executed immediately?

Last Answer : Because she knew where the plans for the death star were and Vader wants to get them back before the rebels work out how to blow the thing up.

Description : Should Khalid Shaikh Mohammed be executed?

Last Answer : No. I oppose the death penalty.

Description : What percentage of people executed are innocent?

Last Answer : answer:From The Death Penalty Information Center There is no way to tell how many of the over 1,000 people executed since 1976 may also have been innocent. Courts do not generally entertain ... -humous pardons and new information about people who may have been wrongfully executed prior to 1976.

Description : If you were going to be executed, what would your last meal consist of?

Last Answer : Ribeye, medium well, baked potato and custard pie.

Description : How would you want to be executed?

Last Answer : Injection. something painless and fast.

Description : Did Gordon Northcott sing 'Silent Night' before he was executed in real life?

Last Answer : According to: River of Blood: Serial Killers and Their Victims by Amanda Howard, Martin Smith - 2004 - Social Science - 372 pages Northcott began his last day on earth screaming, he was terrified of the ... prayer for me . Then the trap door opened. I'm guessing the answer to your question is NO

Description : If you were about to be executed, what would your "last meal" be?

Last Answer : Something that would produce a nasty movement after my bowels relaxed. I would probably request my mothers cooking.

Description : If you were to be executed by midnight what would be your last meal?

Last Answer : Mashed potatoes and gravy, nachos and cheese dip, banana split, lemonade.

Description : If the judge sentenced you to life in prison (no parole ever) or to be executed, the death sentence. Which would you choose?

Last Answer : what’s with all the prison questions?

Description : Do there exist standard speeds at which online communities grow (if they're well executed and useful, of course)?

Last Answer : It all depends on the target audience. A broader group will inevitably lead to faster growth. The distinction between paid and free also changes things.

Description : You are about to be executed, but the king gives you a chance. He says that he will divide 100 marbles in half. 50 of them are black and 50 are white. You can arrange them however you like into two ... one you die. How do you divide the marbles so there is a 50-50 chance you will live? -Riddles

Last Answer : You need to put one white marble in one of the bowls. Then the remaining 49 go with the 50 black marbles. Then you will have a good chance of living.

Description : What kind of candy would a prisoner want before he is executed? -Riddles

Last Answer : A Life Saver.

Description : A king decided to let a prisoner try to escape the prison with his life. The king placed 2 marbles in a jar that was glued to a table. One of the marbles was supposed to be black, and one was ... and that the prisoner was mute so he could not say anything, how did he escape with his life? -Riddles

Last Answer : The prisoner grabbed one of the marbles from the jar and concealed it in his hand. He then swallowed it, and picked up the other marble and showed everyone. The marble was black, and since the other marble was swallowed, it was assumed to be the blue one. So the mean king had to set him free

Description : In 1209, on a hot summer day there was a man who was ordered to be executed by king. The king was a nice king though, and he said that if the man could prove himself wise, he would let him ... The king opened a window, and the man immediately knew which was the real flower. How did he know? -Riddles

Last Answer : When the King opened the window, a bee flew in and landed on the only real flower to gather pollen.

Description : Why was Menocchio executed? -SST 10th

Last Answer : . Menocchio was a miller in Italy who began to read books that were available in his locality. . He reinterpreted the message of the Bible and formed his own views of God that ... then imposed severe controls over publishers and booksellers, and began to maintain an Index of Prohibited Books.

Description : What will be the final value of variable x after the following code is executed: -Technology

Last Answer : The value is:1

Description : Explain with the help of an example that why should atransaction be executed as a whole or it should be not executed at all -Technology

Last Answer : A transaction is a set of changes that must be made together. It is a program unit whose execution mayor may not change the contents of a database. Transaction is executed as a single unit. ... from one bank account to another requires two changes to the database both must succeed or fail together

Description : ‘Class’ table has columns RNO and NAME. The following statements are executed: -Technology

Last Answer : Output for the 1st SELECT * FROM Class ; statement -RNONAME5Rajeev6Chris7FerozeOutput for the llnd SELECT * FROM Class; statementRNONAME5Rajeev6Chris

Description : What values will be displayed in JOptionPane when the following code is executed? -Technology

Last Answer : No value will be displayed in JOptionPane because it will give exception in thread ‘main’ due to null.

Description : What will be the values of i and z after the following code is executed : -Technology

Last Answer : Value of i = 10Value of z = 5

Description : What will be displayed in jTextFieldl and jTextField2 after the following code is executed : -Technology

Last Answer : OutputjTextFieldl will contain value = 12jTextField2 will contain value = 13

Description : The Maratha Chief, Sambhaji was executed during which reign? -Do You Know?

Last Answer : answer:

Last Answer : Ganges water sharing agreement is executed: 6 in Hyderabad, New Delhi

Last Answer : The Dayton Accords are executed at the Dayton Air Base in Ohio, USA

Last Answer : The first Treaty of Versailles was executed in the city of Versailles, France

Last Answer : The Space Agreement was signed on October 10 , 1986.

Description : Hello, I rent an apartment for a person who is in real danger of execution and may be investigated by the police for fraud. The apartment is owned by a different person (he is not the ... the apartment and confiscated some things from me? Alternatively, how to solve this. Thank you for answer.

Last Answer : if he / she had / has permanent residence there, then basically yes, but the executor can raid wherever he suspects that the property belongs to the debtor - and then it is up to you to prove ... them, I would turn to a lawyer for advice, they will probably be photographed and written by protocol)

Description : In the Mexican revolution vitoriano Huerta seized power and executed Francisco Madero which action did the us president take under moral diplomacy?

Last Answer : Feel Free to Answer