COMPUTER SCIENCE AND ENGINEERING
COMPILER DESIGN
Question
[CLICK ON ANY CHOICE TO KNOW THE RIGHT ANSWER]
|
|
Stack-based machine
|
|
Accumulator based machine
|
|
Two operand addresses
|
|
None of the other options
|
Detailed explanation-1: -Architecture. Like many other p-code machines, the UCSD p-Machine is a stack machine, which means that most instructions take their operands from a stack, and place results back on the stack. Thus, the add instruction replaces the two topmost elements of the stack with their sum.
Detailed explanation-2: -Noun. (programming) A very low-level code that is machine-independent and enables a compiled file to be run on different processor types. Most implementations of the Pascal programming language employed a p-code system to achieve a greater level of machine independence.
Detailed explanation-3: -Using a variety of registers, the P-code machine handles a stack to execute the machine code according to inputs; for example, calling functions and procedures accordingly. A P-code machine can be easier to write for than a different model, however, the execution speed can be a bottleneck.
Detailed explanation-4: -The P-machine is a stack machine with two memory stores: the “stack”, which is organized as a stack and contains the data to be used by the PM/0 CPU, and the “code”, which is organized as a list and contains the instructions for the VM. The PM/0 CPU has four registers.
Detailed explanation-5: -In computer science, computer engineering and programming language implementations, a stack machine is a computer processor or a virtual machine in which the primary interaction is moving short-lived temporary values to and from a push down stack. In the case of a hardware processor, a hardware stack is used.