Let’s strip away all the abstractions: Microprocessors & Assembly Language is where you finally meet the machine on its own terms. This isn’t about writing elegant Python. It’s about speaking the raw, unforgiving native tongue of the CPU itself. This past paper is your trial by fire. It tests whether you can think like the hardware, commanding it register by register, cycle by cycle, to make it dance.
Forget high-level functions and garbage collection. This is about registers, memory addresses, opcodes, and flags. It’s the foundation upon which every compiler, every operating system, and every byte of optimized code is built.
What This Paper Actually Executes: Your Hardware-Level Mastery
1. The Architecture: Knowing the Machine’s Soul
You must move from seeing a CPU as a black box to understanding its internal anatomy.
- The CPU Core: Registers are your fast, tiny workspace (AX, BX, CX, DX, SI, DI, SP, BP, IP). The ALU (Arithmetic Logic Unit) does the math. The Control Unit fetches and decodes instructions.
- The Memory Hierarchy: From registers (fastest, smallest) to cache, to RAM (the main “memory” you program against), to disk. You’ll calculate physical addresses from segment:offset pairs (in x86) or flat addresses.
- The Bus System: How data, addresses, and control signals move between CPU, memory, and I/O devices.
2. The Language: Assembly as Mind-Control for Silicon
Assembly Language (ASM) is a mnemonic, human-readable 1:1 mapping to machine code. You must become fluent.
- Instruction Set Architecture (ISA): The dictionary of commands. You’ll master data movement (
MOV,LEA), arithmetic (ADD,SUB,MUL,DIV), logic (AND,OR,XOR,NOT), and control flow (JMP,CMP,Jccconditional jumps like JE, JNE, JG). - Addressing Modes: This is critical. How do you specify where the data is?
- Immediate:
MOV AX, 5(value is in the instruction) - Register:
ADD AX, BX - Direct:
MOV AX, [1234h](address is in the instruction) - Register Indirect:
MOV AX, [SI](address is in a register) - Based/Indexed/Displaced:
MOV AX, [BX+SI+10h](combinations for arrays/structures)
- Immediate:
- The Stack: A LIFO region of memory. You’ll use
PUSH,POP,CALL,RET. You must diagram stack frames for procedures, showing how parameters, return addresses, and local variables are organized.
3. The Interface: Talking to the Outside World
Computers must interact.
- I/O Operations: Port-mapped I/O (
IN,OUTinstructions) vs. memory-mapped I/O. - Interrupts & Exceptions: How the CPU handles asynchronous events (a key press, a timer tick) or errors (division by zero). You’ll understand the Interrupt Vector Table (IVT) and the save/restore process.
4. The Core Skill: Tracing and Debugging at the Metal Level
The paper will heavily test your ability to be the CPU.
- You’ll be given a block of assembly code and initial register/memory values.
- You must execute it line-by-line, producing a final register dump and memory state.
- This reveals your true understanding of every instruction’s side effects.
5. The Synthesis: From C to Assembly and Back
A key learning outcome is connecting high-level constructs to their low-level reality.
- Compiler Output: Given a simple C function (e.g., a loop or an
if-else), you’ll predict or recognize the equivalent assembly. - Procedure Call Convention: The rules for how functions pass arguments (on stack? in registers?), save registers, and clean up. This is the glue of software.
6. The Modern Context: From 8086 to Today
While often taught with x86 (16-bit or 32-bit) as a model, the concepts are universal. You’ll appreciate:
- RISC vs. CISC: The philosophical divide (fewer, simpler instructions vs. many, complex ones).
- Pipelining & Parallelism: Basic concepts of how modern CPUs execute multiple instructions concurrently to achieve performance.
The Paper’s Ultimate Challenge: The Multi-Layer Puzzle
The hardest questions combine it all:
*”Write an x86 assembly procedure to_upper that takes a pointer to a null-terminated string and converts all lowercase letters to uppercase in place. Diagram the stack frame at the point of the first character modification. Then, assuming the string ‘HeLLo123’ is at address 0x1000, trace the execution of your code until the first non-alphabetic character is encountered, showing the state of key registers (SI, AL) after each relevant instruction.”*
This tests coding, system knowledge, and meticulous tracing simultaneously.
How to Master This Past Paper:
- Think in Registers and Memory Addresses. Your mental model should be the CPU’s: a small set of registers and a giant array of memory cells. Nothing else exists.
- Practice Manual Execution Religiously. Get a blank sheet. Write down initial register values. Execute each instruction, updating your “register dump” and “memory map.” This is the single most important skill.
- Master the Flags. The FLAGS register (Zero, Sign, Carry, Overflow) is the CPU’s condition report. Know how every arithmetic/logic instruction sets them and how every conditional jump (
JZ,JS,JC,JO) uses them. - Draw Stack Frames. For any
CALL, draw the stack. Show where the return address is, where the old BP is saved, where locals begin. This makes procedure logic crystal clear. - Connect the Dots. When you learn an instruction, ask: “What high-level concept does this implement?” (
LOOPis aforloop.CALL/RETis a function. Conditional jumps areif/else). This builds the crucial bridge between layers of abstraction.
This past paper is your right of passage to the machine’s inner sanctum. It proves you have peeled back the layers of abstraction and can command the hardware directly. Passing it means you don’t just write code; you understand the physical reality of its execution. You become a programmer who truly knows what is happening under the hood.
M&AL Sessional I in past paper

M&AL Sessional II in past paper
Write a program (MASM code) that subtracts three integers (X, Y, Z). Insert a call DumpRegs statement to display the register values.
X = Your Roll number
Y = X*2
Z = 10
Question 02: [05×01]
Calculate the number of elements of the following arrays
- a) Array1 BYTE 10h,20h,30h
- b) Array2 WORD 1000h,2000h,3000h
- c) Array3 DWORD 10000h,20000h,30000h
- Array4 WORD 1,2,3
- Array5 DWORD 4,5,6
Hint: Use $ Operator. Complete code is not required just write one MASM code statement.
M&AL Sessional I in final paper
The greatest common divisor (GCD) of two integers is the largest integer that will evenly divide both integers. The GCD algorithm involves integer division in a loop, described by the following C++ code:
int GCD(int x, int y)
{
x = abs(x); // absolute value y = abs(y);
do {
int n = x % y; x = y;
y = n;
} while (y > 0); return x;
}
Implement this function in assembly language and write a test program that calls the function several times, passing it different values. Display all results on the screen.
Question 02: [10]
Write an application that does the following:
- Fill an array with 9 random integers and use Your Roll Number as 10th
- Sort through the array, displaying each value, and count the number of negative values
- After the loop finishes, display the count and the last