{"id":259,"date":"2026-01-29T12:19:18","date_gmt":"2026-01-29T12:19:18","guid":{"rendered":"https:\/\/staymind.shop\/?p=259"},"modified":"2026-01-29T12:19:20","modified_gmt":"2026-01-29T12:19:20","slug":"paper-of-mal-department-of-computer-science-and-software-engineering","status":"publish","type":"post","link":"https:\/\/staymind.shop\/?p=259","title":{"rendered":"Paper Of M&amp;AL Department Of Computer Science and Software Engineering"},"content":{"rendered":"\n<p>Let&#8217;s strip away all the abstractions:&nbsp;<strong>Microprocessors &amp; Assembly Language<\/strong>&nbsp;is where you finally meet the machine on its own terms. This isn&#8217;t about writing elegant Python. It&#8217;s about speaking the&nbsp;<strong>raw, unforgiving native tongue of the CPU itself<\/strong>. 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.<\/p>\n\n\n\n<p>Forget high-level functions and garbage collection. This is about&nbsp;<strong>registers, memory addresses, opcodes, and flags<\/strong>. It&#8217;s the foundation upon which every compiler, every operating system, and every byte of optimized code is built.<\/p>\n\n\n\n<p><strong>What This Paper Actually Executes: Your Hardware-Level Mastery<\/strong><\/p>\n\n\n\n<p><strong>1. The Architecture: Knowing the Machine&#8217;s Soul<\/strong><br>You must move from seeing a CPU as a black box to understanding its internal anatomy.<\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li><strong>The CPU Core:<\/strong>\u00a0<strong>Registers<\/strong>\u00a0are your fast, tiny workspace (AX, BX, CX, DX, SI, DI, SP, BP, IP). The\u00a0<strong>ALU<\/strong>\u00a0(Arithmetic Logic Unit) does the math. The\u00a0<strong>Control Unit<\/strong>\u00a0fetches and decodes instructions.<\/li>\n\n\n\n<li><strong>The Memory Hierarchy:<\/strong>\u00a0From registers (fastest, smallest) to cache, to RAM (the main &#8220;memory&#8221; you program against), to disk. You&#8217;ll calculate\u00a0<strong>physical addresses<\/strong>\u00a0from segment:offset pairs (in x86) or flat addresses.<\/li>\n\n\n\n<li><strong>The Bus System:<\/strong>\u00a0How data, addresses, and control signals move between CPU, memory, and I\/O devices.<\/li>\n<\/ul>\n\n\n\n<p><strong>2. The Language: Assembly as Mind-Control for Silicon<\/strong><br>Assembly Language (ASM) is a&nbsp;<strong>mnemonic, human-readable 1:1 mapping to machine code<\/strong>. You must become fluent.<\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li><strong>Instruction Set Architecture (ISA):<\/strong>\u00a0The dictionary of commands. You&#8217;ll master data movement (<code>MOV<\/code>,\u00a0<code>LEA<\/code>), arithmetic (<code>ADD<\/code>,\u00a0<code>SUB<\/code>,\u00a0<code>MUL<\/code>,\u00a0<code>DIV<\/code>), logic (<code>AND<\/code>,\u00a0<code>OR<\/code>,\u00a0<code>XOR<\/code>,\u00a0<code>NOT<\/code>), and control flow (<code>JMP<\/code>,\u00a0<code>CMP<\/code>,\u00a0<code>Jcc<\/code>\u00a0conditional jumps like JE, JNE, JG).<\/li>\n\n\n\n<li><strong>Addressing Modes:<\/strong>\u00a0This is critical. How do you specify\u00a0<em>where<\/em>\u00a0the data is?\n<ul class=\"wp-block-list\">\n<li>Immediate:\u00a0<code>MOV AX, 5<\/code>\u00a0(value is in the instruction)<\/li>\n\n\n\n<li>Register:\u00a0<code>ADD AX, BX<\/code><\/li>\n\n\n\n<li>Direct:\u00a0<code>MOV AX, [1234h]<\/code>\u00a0(address is in the instruction)<\/li>\n\n\n\n<li>Register Indirect:\u00a0<code>MOV AX, [SI]<\/code>\u00a0(address is\u00a0<em>in<\/em>\u00a0a register)<\/li>\n\n\n\n<li>Based\/Indexed\/Displaced:\u00a0<code>MOV AX, [BX+SI+10h]<\/code>\u00a0(combinations for arrays\/structures)<\/li>\n<\/ul>\n<\/li>\n\n\n\n<li><strong>The Stack:<\/strong>\u00a0A LIFO region of memory. You&#8217;ll use\u00a0<code>PUSH<\/code>,\u00a0<code>POP<\/code>,\u00a0<code>CALL<\/code>,\u00a0<code>RET<\/code>. You must diagram\u00a0<strong>stack frames<\/strong>\u00a0for procedures, showing how parameters, return addresses, and local variables are organized.<\/li>\n<\/ul>\n\n\n\n<p><strong>3. The Interface: Talking to the Outside World<\/strong><br>Computers must interact.<\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li><strong>I\/O Operations:<\/strong>\u00a0Port-mapped I\/O (<code>IN<\/code>,\u00a0<code>OUT<\/code>\u00a0instructions) vs. memory-mapped I\/O.<\/li>\n\n\n\n<li><strong>Interrupts &amp; Exceptions:<\/strong>\u00a0How the CPU handles asynchronous events (a key press, a timer tick) or errors (division by zero). You&#8217;ll understand the\u00a0<strong>Interrupt Vector Table (IVT)<\/strong>\u00a0and the save\/restore process.<\/li>\n<\/ul>\n\n\n\n<p><strong>4. The Core Skill: Tracing and Debugging at the Metal Level<\/strong><br>The paper will heavily test your ability to&nbsp;<strong>be the CPU<\/strong>.<\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li>You&#8217;ll be given a block of assembly code and initial register\/memory values.<\/li>\n\n\n\n<li>You must\u00a0<strong>execute it line-by-line<\/strong>, producing a final register dump and memory state.<\/li>\n\n\n\n<li>This reveals your true understanding of every instruction&#8217;s side effects.<\/li>\n<\/ul>\n\n\n\n<p><strong>5. The Synthesis: From C to Assembly and Back<\/strong><br>A key learning outcome is connecting high-level constructs to their low-level reality.<\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li><strong>Compiler Output:<\/strong>\u00a0Given a simple C function (e.g., a loop or an\u00a0<code>if-else<\/code>), you&#8217;ll predict or recognize the equivalent assembly.<\/li>\n\n\n\n<li><strong>Procedure Call Convention:<\/strong>\u00a0The rules for how functions pass arguments (on stack? in registers?), save registers, and clean up. This is the glue of software.<\/li>\n<\/ul>\n\n\n\n<p><strong>6. The Modern Context: From 8086 to Today<\/strong><br>While often taught with x86 (16-bit or 32-bit) as a model, the concepts are universal. You&#8217;ll appreciate:<\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li><strong>RISC vs. CISC:<\/strong>\u00a0The philosophical divide (fewer, simpler instructions vs. many, complex ones).<\/li>\n\n\n\n<li><strong>Pipelining &amp; Parallelism:<\/strong>\u00a0Basic concepts of how modern CPUs execute multiple instructions concurrently to achieve performance.<\/li>\n<\/ul>\n\n\n\n<p><strong>The Paper&#8217;s Ultimate Challenge: The Multi-Layer Puzzle<\/strong><br>The hardest questions combine it all:<br>*&#8221;Write an x86 assembly procedure&nbsp;<code>to_upper<\/code>&nbsp;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 &#8216;HeLLo123&#8217; 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.&#8221;*<br>This tests coding, system knowledge, and meticulous tracing simultaneously.<\/p>\n\n\n\n<p><strong>How to Master This Past Paper:<\/strong><\/p>\n\n\n\n<ol start=\"1\" class=\"wp-block-list\">\n<li><strong>Think in Registers and Memory Addresses.<\/strong>\u00a0Your mental model should be the CPU&#8217;s: a small set of registers and a giant array of memory cells. Nothing else exists.<\/li>\n\n\n\n<li><strong>Practice Manual Execution Religiously.<\/strong>\u00a0Get a blank sheet. Write down initial register values. Execute each instruction, updating your &#8220;register dump&#8221; and &#8220;memory map.&#8221; This is the single most important skill.<\/li>\n\n\n\n<li><strong>Master the Flags.<\/strong>\u00a0The\u00a0<strong>FLAGS register<\/strong>\u00a0(Zero, Sign, Carry, Overflow) is the CPU&#8217;s condition report. Know how every arithmetic\/logic instruction sets them and how every conditional jump (<code>JZ<\/code>,\u00a0<code>JS<\/code>,\u00a0<code>JC<\/code>,\u00a0<code>JO<\/code>) uses them.<\/li>\n\n\n\n<li><strong>Draw Stack Frames.<\/strong>\u00a0For any\u00a0<code>CALL<\/code>, draw the stack. Show where the return address is, where the old BP is saved, where locals begin. This makes procedure logic crystal clear.<\/li>\n\n\n\n<li><strong>Connect the Dots.<\/strong>\u00a0When you learn an instruction, ask: &#8220;What high-level concept does this implement?&#8221; (<code>LOOP<\/code>\u00a0is a\u00a0<code>for<\/code>\u00a0loop.\u00a0<code>CALL\/RET<\/code>\u00a0is a function. Conditional jumps are\u00a0<code>if\/else<\/code>). This builds the crucial bridge between layers of abstraction.<\/li>\n<\/ol>\n\n\n\n<p>This past paper is your&nbsp;<strong>right of passage to the machine&#8217;s inner sanctum<\/strong>. It proves you have peeled back the layers of abstraction and can command the hardware directly. Passing it means you don&#8217;t just write code; you understand the&nbsp;<strong>physical reality of its execution<\/strong>. You become a programmer who truly knows what is happening under the hood.<\/p>\n\n\n\n<p><strong>M&amp;AL\u00a0Sessional I in past paper<\/strong><\/p>\n\n\n<div class=\"wp-block-image\">\n<figure class=\"aligncenter size-full\"><img loading=\"lazy\" decoding=\"async\" width=\"772\" height=\"653\" src=\"https:\/\/staymind.shop\/wp-content\/uploads\/2026\/01\/image-90.png\" alt=\"\" class=\"wp-image-262\" srcset=\"https:\/\/staymind.shop\/wp-content\/uploads\/2026\/01\/image-90.png 772w, https:\/\/staymind.shop\/wp-content\/uploads\/2026\/01\/image-90-300x254.png 300w, https:\/\/staymind.shop\/wp-content\/uploads\/2026\/01\/image-90-768x650.png 768w\" sizes=\"auto, (max-width: 772px) 100vw, 772px\" \/><\/figure>\n<\/div>\n\n\n<p><strong>M&amp;AL Sessional II in past paper<br><\/strong>Write a program (MASM code) that subtracts three integers (X, Y, Z). Insert a call DumpRegs statement to display the register values.<\/p>\n\n\n\n<p><strong>X&nbsp;<\/strong>= Your Roll number<\/p>\n\n\n\n<p><strong>Y&nbsp;<\/strong>= X*2<\/p>\n\n\n\n<p><strong>Z&nbsp;<\/strong>= 10<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">Question 02:&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; [05\u00d701]<\/h2>\n\n\n\n<p><strong>&nbsp;<\/strong>Calculate the number of elements of the following arrays<\/p>\n\n\n\n<ol class=\"wp-block-list\">\n<li><strong>a)\u00a0<\/strong>Array1 BYTE 10h,20h,30h<\/li>\n\n\n\n<li><strong>b)\u00a0<\/strong>Array2 WORD 1000h,2000h,3000h<\/li>\n\n\n\n<li><strong>c)\u00a0<\/strong>Array3 DWORD 10000h,20000h,30000h<\/li>\n\n\n\n<li>Array4 WORD 1,2,3<\/li>\n\n\n\n<li>Array5 DWORD 4,5,6<\/li>\n<\/ol>\n\n\n\n<p><strong>Hint:\u00a0<\/strong>Use $ Operator. Complete code is not required just write one MASM code statement.<\/p>\n\n\n\n<p><strong>M&amp;AL Sessional I in final paper<br><\/strong><\/p>\n\n\n\n<p>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:<\/p>\n\n\n\n<p>int GCD(int x, int y)<\/p>\n\n\n\n<p>{<\/p>\n\n\n\n<p>x = abs(x); \/\/ absolute value y = abs(y);<\/p>\n\n\n\n<p>do {<\/p>\n\n\n\n<p>int n = x % y; x = y;<\/p>\n\n\n\n<p>y = n;<\/p>\n\n\n\n<p>} while (y &gt; 0); return x;<\/p>\n\n\n\n<p>}<\/p>\n\n\n\n<p>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.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">Question 02:&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; [10]<\/h2>\n\n\n\n<p>Write an application that does the following:<\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li>Fill an array with 9 random integers and use Your Roll Number as 10<sup>th<\/sup><\/li>\n\n\n\n<li>Sort through the array, displaying each value, and count the number of negative values<\/li>\n\n\n\n<li>After the loop finishes, display the count and the last<\/li>\n<\/ul>\n","protected":false},"excerpt":{"rendered":"<p>Let&#8217;s strip away all the abstractions:&nbsp;Microprocessors &amp; Assembly Language&nbsp;is where you finally meet the machine on its own terms. This isn&#8217;t about writing elegant Python. It&#8217;s about speaking the&nbsp;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 [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":260,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[62],"tags":[4,63,5,6,7,8,10],"class_list":["post-259","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-mal","tag-comsats","tag-mal","tag-new","tag-paper","tag-past","tag-past_paper","tag-start"],"_links":{"self":[{"href":"https:\/\/staymind.shop\/index.php?rest_route=\/wp\/v2\/posts\/259","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/staymind.shop\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/staymind.shop\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/staymind.shop\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/staymind.shop\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=259"}],"version-history":[{"count":1,"href":"https:\/\/staymind.shop\/index.php?rest_route=\/wp\/v2\/posts\/259\/revisions"}],"predecessor-version":[{"id":263,"href":"https:\/\/staymind.shop\/index.php?rest_route=\/wp\/v2\/posts\/259\/revisions\/263"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/staymind.shop\/index.php?rest_route=\/wp\/v2\/media\/260"}],"wp:attachment":[{"href":"https:\/\/staymind.shop\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=259"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/staymind.shop\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=259"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/staymind.shop\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=259"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}