Ch 06: Parameter Passing and Stack Frames

216 Questions216 MCQs0 Short Questions0 Long Questions
๐ŸŽฏ Exam Practice Papers
SEMESTER PASS

CS401 - Computer Architecture and Assembly Language Programming Examination Practice

Timed practice exam simulation for CS401 - Computer Architecture and Assembly Language Programming.

๐Ÿ“˜ VU MID TERM EXAMLectures 1 to 22
โฑ๏ธ 60 Mins

Mid Term Examination

Covers syllabus of Lectures 1 to 22 with 30 high-yield MCQs in a timed exam environment.

๐Ÿ“30 MCQs
โฑ๏ธ60 Minutes
๐Ÿ“— VU FINAL TERM EXAMLectures 23 to 45
โฑ๏ธ 90 Mins

Final Term Examination

Comprehensive semester exam preparation with 45 MCQs covering Lectures 23 to 45 with complete course coverage.

๐Ÿ“45 MCQs
โฑ๏ธ90 Minutes
Showing 61 โ€“ 70 of 216 Questions
Page 7 of 22
Q61
โ“ MCQ๐Ÿ“˜ CS401๐Ÿ“‘ Lec 6๐Ÿท๏ธ 6.1. Bit Manipulation (SAR Arithmetic Right Shift Sign Preservation)Easy๐Ÿ”โญ๐Ÿ’ก๐Ÿ“„๐ŸŽ“VU๐Ÿ›๏ธVU
After the execution of a Shift Arithmetic Right (`SAR`) instruction on a signed binary operand, what happens to the Most Significant Bit (MSB / sign bit)?
๐Ÿ’ป assembly Snippet
mov al, 10000000b (-128)
sar al, 1 ; AL = 11000000b (-64), MSB remains 1
  1. A.The msb is replaced by a 0
  2. B.The msb is replaced by 1
  3. C.The msb retains its original value
  4. D.The msb is replaced by the value of CF
Q62
โ“ MCQ๐Ÿ“˜ CS401๐Ÿ“‘ Lec 6๐Ÿท๏ธ 6.1. Control Flow Instructions (Far Jump Absolute Addressing)Easy๐Ÿ”โญ๐Ÿ’ก๐Ÿ“„๐ŸŽ“VU๐Ÿ›๏ธVU
Unlike a short or near jump which is position-relative to the current Instruction Pointer (`IP`), a far jump instruction is __________ because it explicitly specifies both segment and offset target addresses.
๐Ÿ’ป assembly Snippet
jmp 0x1000:0x0000 ; Absolute far jump reloads CS and IP
  1. A.memory dependent
  2. B.Absolute
  3. C.temporary
  4. D.indirect
Q63
๐Ÿ“ Short Q๐Ÿ“˜ CS401๐Ÿ“‘ Lec 6๐Ÿท๏ธ 6.1. Control Flow Instructions (Busy Wait Delay Loop via LOOP)Easy๐Ÿ”โญ๐Ÿ’ก๐Ÿ“„๐ŸŽ“VU๐Ÿ›๏ธVU
Briefly describe what the following assembly code sequence accomplishes in a single line: `mov cx, 0xffff` `loop $`
๐Ÿ’ป assembly Snippet
mov cx, 0xffff ; Load max 16-bit count
loop $        ; Jump to current instruction offset ($) while CX != 0
Q64
โ“ MCQ๐Ÿ“˜ CS401๐Ÿ“‘ Lec 6๐Ÿท๏ธ 6.1. Bit Manipulation (SHR Logical Right Shift Diagram)Easy๐Ÿ”โญ๐Ÿ’ก๐Ÿ“„๐ŸŽ“VU๐Ÿ›๏ธVU
The bit diagram `| 0 | --> | 1 | 1 | 0 | 1 | 0 | 0 | 0 | --> | C |` illustrates which right-shift operation where 0 enters the MSB and the LSB is shifted into the Carry Flag?
๐Ÿ’ป assembly Snippet
shr al, 1 ; Shifts AL right: 0 -> MSB, LSB -> Carry Flag
  1. A.Shl
  2. B.sar
  3. C.Shr
  4. D.Sal
Q65
โ“ MCQ๐Ÿ“˜ CS401๐Ÿ“‘ Lec 6๐Ÿท๏ธ 6.1. Bit Manipulation (SHL Logical Left Shift Diagram)Easy๐Ÿ”โญ๐Ÿ’ก๐Ÿ“„๐ŸŽ“VU๐Ÿ›๏ธVU
The bit diagram `| C | <-- | 1 | 1 | 0 | 1 | 0 | 0 | 0 | <-- | 0 |` illustrates which left-shift operation where 0 enters the LSB and the MSB is shifted into the Carry Flag?
๐Ÿ’ป assembly Snippet
shl al, 1 ; Shifts AL left: MSB -> Carry Flag, LSB <- 0
  1. A.Shl
  2. B.sar
  3. C.Shr
  4. D.Sal
Q66
โ“ MCQ๐Ÿ“˜ CS401๐Ÿ“‘ Lec 6๐Ÿท๏ธ 6.1. Control Flow Instructions (JNE vs JNZ Mnemonic Semantics)Easy๐Ÿ”โญ๐Ÿ’ก๐Ÿ“„๐ŸŽ“VU๐Ÿ›๏ธVU
Since `JNE` (Jump if Not Equal) and `JNZ` (Jump if Not Zero) assemble into the exact same machine opcode (`0x75`), the distinction between these two mnemonics exists strictly for __________.
๐Ÿ’ป assembly Snippet
cmp ax, bx
jne label ; Checks equality logically (ZF = 0)

sub ax, 1
jnz label ; Checks zero arithmetic result (ZF = 0)
  1. A.Programmer or Logic
  2. B.Assembler
  3. C.Debugger
  4. D.iAPX88
Q67
โ“ MCQ๐Ÿ“˜ CS401๐Ÿ“‘ Lec 6๐Ÿท๏ธ 6.1. Control Flow Instructions (Unconditional Jump JMP)Easy๐Ÿ”โญ๐Ÿ’ก๐Ÿ“„๐ŸŽ“VU๐Ÿ›๏ธVU
An instruction that upon execution transfers control unconditionally to a target address regardless of processor flags is called a(n) __________.
๐Ÿ’ป assembly Snippet
jmp target_label ; Unconditional branch
  1. A.Jump
  2. B.Conditional jump
  3. C.Unconditional jump
  4. D.Stay
Q68
โ“ MCQ๐Ÿ“˜ CS401๐Ÿ“‘ Lec 6๐Ÿท๏ธ 6.1. Control Flow Instructions (CMP Zero Flag Equality Logic)Easy๐Ÿ”โญ๐Ÿ’ก๐Ÿ“„๐ŸŽ“VU๐Ÿ›๏ธVU
When comparing two numbers (`CMP DEST, SRC`), if subtracting the source from the destination yields zero, the Zero Flag is set (`ZF = 1`). This indicates that __________.
๐Ÿ’ป assembly Snippet
cmp ax, bx ; Performs AX - BX
; If AX == BX, ZF = 1
  1. A.DEST = SRC
  2. B.DEST!= SRC
  3. C.DEST < SRC
  4. D.DEST > SRC
Q69
โ“ MCQ๐Ÿ“˜ CS401๐Ÿ“‘ Lec 6๐Ÿท๏ธ 6.1. Control Flow Instructions (Carry Flag Unsigned Below Logic)Easy๐Ÿ”โญ๐Ÿ’ก๐Ÿ“„๐ŸŽ“VU๐Ÿ›๏ธVU
When an unsigned source operand is subtracted from an unsigned destination operand (`CMP DEST, SRC`) and the destination is smaller (`DEST < SRC`), a borrow occurs, which sets the __________.
๐Ÿ’ป assembly Snippet
mov ax, 5
cmp ax, 10 ; 5 - 10 requires borrow -> CF = 1
  1. A.carry flag i.e CF = 0
  2. B.carry flag i.e CF = 1
  3. C.Carry Flag + ZF=1
  4. D.None of the Given
Q70
โ“ MCQ๐Ÿ“˜ CS401๐Ÿ“‘ Lec 6๐Ÿท๏ธ 6.1. Control Flow Instructions (JBE Unsigned Below or Equal Logic)Easy๐Ÿ”โญ๐Ÿ’ก๐Ÿ“„๐ŸŽ“VU๐Ÿ›๏ธVU
In unsigned comparison (`CMP DEST, SRC`), if the result produces `ZF = 1` OR `CF = 1`, which relationship condition between unsigned destination (`UDEST`) and unsigned source (`USRC`) is satisfied?
๐Ÿ’ป assembly Snippet
cmp ax, bx
jbe label ; Jumps if ZF = 1 or CF = 1 (AX <= BX unsigned)
  1. A.DEST = SRC
  2. B.DEST!= SRC
  3. C.UDEST <= USRC
  4. D.DEST > SRC