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 121 โ€“ 130 of 216 Questions
Page 13 of 22
Q121
โ“ MCQ๐Ÿ“˜ CS401๐Ÿ“‘ Lec 6๐Ÿท๏ธ 6.1. Bit Manipulation (Four Fundamental Masking Operations)Easy๐Ÿ”โญ๐Ÿ’ก๐Ÿ“„๐ŸŽ“VU๐Ÿ›๏ธVU
In assembly language bit manipulation, masking operations are categorized into four primary selective bit operations:
๐Ÿ’ป assembly Snippet
; 1. Clear: AND ax, mask_with_zeros
; 2. Set:   OR  ax, mask_with_ones
; 3. Invert:XOR ax, mask_with_ones
; 4. Test:  AND/TEST ax, mask_with_ones
  1. A.Selective Bit Clearing, Setting, Inversion, and Testing
  2. B.Selective Bit Addition, Subtraction, Multiplication, and Division
  3. C.Selective Bit Shifting, Rotating, Moving, and Swapping
  4. D.Selective Bit Masking, Pushing, Popping, and Calling
Q122
โ“ MCQ๐Ÿ“˜ CS401๐Ÿ“‘ Lec 6๐Ÿท๏ธ 6.1. Bit Manipulation (SHL Left Shift Multiplication Mechanics)Easy๐Ÿ”โญ๐Ÿ’ก๐Ÿ“„๐ŸŽ“VU๐Ÿ›๏ธVU
Suppose register `AL` contains the decimal value 5. After performing two left shift operations (`SHL AL, 2` / `SAL AL, 2`), what is the resulting decimal value in `AL`?
๐Ÿ’ป assembly Snippet
mov al, 5   ; AL = 5 (00000101b)
shl al, 2   ; AL = 20 (00010100b)
  1. A.5
  2. B.10
  3. C.15
  4. D.20
Q123
โ“ MCQ๐Ÿ“˜ CS401๐Ÿ“‘ Lec 6๐Ÿท๏ธ 6.1. Control Flow Instructions (Short, Near, and Far Jump Classification)Easy๐Ÿ”โญ๐Ÿ’ก๐Ÿ“„๐ŸŽ“VU๐Ÿ›๏ธVU
In x86 assembly language control flow, what are the three primary types of jump instructions based on target displacement distance?
๐Ÿ’ป assembly Snippet
; Short Jump: -128 to +127 bytes
; Near Jump:  16-bit offset in same segment
; Far Jump:   32-bit pointer (CS:IP) across segments
  1. A.short, near
  2. B.short, near, far
  3. C.near, far
  4. D.short, far
Q124
๐Ÿ“ Short Q๐Ÿ“˜ CS401๐Ÿ“‘ Lec 6๐Ÿท๏ธ 6.1. Control Flow Instructions (Short Jump Definition and Encoding)Easyโญ๐Ÿ’ก๐Ÿ“„๐ŸŽ“VU๐Ÿ›๏ธVU
Define a 'short jump' in x86 assembly language control flow.
๐Ÿ’ป assembly Snippet
; Example: jmp short my_label (Opcode: EB, Operand: 8-bit signed displacement)
Q125
โ“ MCQ๐Ÿ“˜ CS401๐Ÿ“‘ Lec 6๐Ÿท๏ธ 6.1. Bit Manipulation (SAR Shift Arithmetic Right Sign Preservation)Easy๐Ÿ”โญ๐Ÿ’ก๐Ÿ“„๐ŸŽ“VU๐Ÿ›๏ธVU
After the execution of the `SAR` (Shift Arithmetic Right) instruction, how is the Most Significant Bit (MSB) affected?
๐Ÿ’ป assembly Snippet
mov al, 0x80 ; AL = 10000000b (-128)
sar al, 1    ; AL = 11000000b (-64, MSB retains 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
Q126
โ“ MCQ๐Ÿ“˜ CS401๐Ÿ“‘ Lec 6๐Ÿท๏ธ 6.1. Control Flow Instructions (Absolute Far Jump Mechanics)Easy๐Ÿ”โญ๐Ÿ’ก๐Ÿ“„๐ŸŽ“VU๐Ÿ›๏ธVU
Unlike short and near jumps which specify relative offsets, a 'Far' jump instruction is not position-relative but is __________.
๐Ÿ’ป assembly Snippet
jmp 0x1000:0x0020 ; Absolute Far Jump specifying new CS and IP
  1. A.memory dependent
  2. B.Absolute
  3. C.temporary
  4. D.indirect
Q127
๐Ÿ“ Short Q๐Ÿ“˜ CS401๐Ÿ“‘ Lec 6๐Ÿท๏ธ 6.1. Control Flow Instructions (Inter-Segment Far Jump CS:IP Reloading)Mediumโญ๐Ÿ’ก๐Ÿ“„๐ŸŽ“VU๐Ÿ›๏ธVU
Why is it necessary to provide both segment and offset addresses when executing a FAR jump instruction in x86 assembly language?
๐Ÿ’ป assembly Snippet
jmp 0x2000:0x0010 ; Far Jump: Loads CS = 0x2000 and IP = 0x0010
Q128
๐Ÿง  Long Problem๐Ÿ“˜ CS401๐Ÿ“‘ Lec 6๐Ÿท๏ธ 6.1. Bit Manipulation (32-Bit Extended Shifting via SHL and RCL)Hardโญ๐Ÿ’ก๐Ÿ“„๐ŸŽ“VU๐Ÿ›๏ธVU
Explain how multi-word extended shifting (32-bit left shift) is performed on a 16-bit x86 processor architecture, providing example assembly instructions and explaining the role of the Carry Flag (`CF`).
๐Ÿ’ป assembly Snippet
num1: dd 40000
shl word [num1], 1   ; Shift lower word, MSB -> CF
rcl word [num1+2], 1 ; Rotate upper word through CF, CF -> LSB
Q129
๐Ÿง  Long Problem๐Ÿ“˜ CS401๐Ÿ“‘ Lec 6๐Ÿท๏ธ Number Printing and Stack SubroutinesHardโญ๐Ÿ’ก๐ŸŒŸ๐Ÿ“„๐ŸŽ“VU๐Ÿ›๏ธVU
Write an 8088 assembly language subroutine named 'ConvertBinaryToDecimal' that receives the starting address of an ASCII binary string (e.g., '11011' or '1001') via the stack. The function must calculate its decimal equivalent and print the decimal value on the screen. Ensure proper stack frame management and register preservation.
๐Ÿ’ป assembly Snippet
push string_addr
call ConvertBinaryToDecimal
Q130
โ“ MCQ๐Ÿ“˜ CS401๐Ÿ“‘ Lec 6๐Ÿท๏ธ Block Processing Instructions and String OperationsEasy๐Ÿ”โญ๐Ÿ’ก๐Ÿ“„๐ŸŽ“VU๐Ÿ›๏ธVU
In primitive form, block processing instructions operate on ________ of memory at one time.
๐Ÿ’ป assembly Snippet
movsb
  1. A.Whole block
  2. B.A single cell
  3. C.A single bit
  4. D.Whole segment