Answers of Assembly Question
Answers of Assembly Question
Q1) Why programs created from assembly can be more efficient and faster
than program created with a compiler?
Ans) Assembly lets you control hardware directly, making code specific and
efficient. Compiled code adds layers, potentially slowing it down.
Q2) What is the difference between high level language compiler and low
level language assembler?
Ans) High-level language compiler translates code written in a user-friendly
language (like C++) into machine code. Low-level language assembler
converts assembly language code, providing a more direct interface to
hardware.
Q3) What is the difference between program counter and pointer?
Ans) Program Counter (PC) tracks the instruction being used in a program. A
pointer holds the memory address of data. PC is for program flow, and a
pointer is for pointing to data in memory.
Q4) In what type of memory the assembler stores the object code?
Ans) The assembler stores the object code generated from assembly
language in the computer's secondary memory (HDD or SSD).
Q5) What is instruction execution cycle?
Ans) The instruction execution cycle is the process a computer follows to
fetch, decode, and execute an instruction. It involves fetching the instruction
from memory, decoding it to understand the operation, fetching data if
needed, and finally, executing the instruction.
Q6) What is a non pipelined processor?
Ans) A non-pipelined processor executes instructions one at a time without
overlapping stages of instruction processing. It goes through the entire
instruction execution cycle for one instruction before starting the next,
leading to potentially slower overall performance compared to a pipelined
processor.
Q7) What is assemble link execute cycle?
Ans) The assemble-link-execute cycle, often referred to as the compilation
and execution cycle, involves three main steps:
1. Assembly: The source code written in assembly language is translated
into machine code or object code by an assembler.
2. Linking: If the program consists of multiple source files, the linker
combines them into a single executable file, resolving addresses and
references between different parts of the program.
3. Execution: The compiled and linked program is executed by the
computer, running through the instructions and producing the desired
output.
Q8) In assembly language programming, what is the minimum number of
operands required for an instruction?
Ans) Instructions in assembly language usually require a minimum of one
operand.
Q9) What is control unit’s function in CPU?
Ans) Control unit in a CPU oversees instruction execution. It fetches,
decodes, and coordinates instructions, managing data flow within the CPU
and with external devices.
Q10) What is the difference between instruction pointer and program
counter?
Ans) Instruction pointer (IP) and program counter (PC) are often used
interchangeably, but in some contexts, they can have slight differences.
Program Counter (PC): This term is more common and is generally used to
represent the address of the next instruction to be executed in the
sequence. It's a term often associated with machine-level instructions.
Instruction Pointer (IP): This term is often used in the context of higher-level
languages or in specific architectures. It also typically refers to the register
or memory location that holds the address of the next instruction.