A
B
C
D
E
100

Scenario 9: Irene is using NASM and needs to understand file sections.

Which section in NASM is used for uninitialized data that does not need to be stored in the executable file?

  • A) .text
  • B) .data
  • C) .bss
  • D) .code

C) .bss

100

Scenario 8: Henry is compiling his NASM program on Ubuntu.

Which command should Henry use to generate an executable from his object file?

  • A) ld  program.o -o program
  • B) gcc -o program program.o
  • C) nasm -o program program.o
  • D) link -o program program.o

A) ld  program.o -o program

100

Scenario 8: Henry is compiling his NASM program on Ubuntu.

Henry wants to create an object file named program.o from his NASM source file program.asm. Which command should he use?

  • A) nasm -f elf64 program.asm
  • B) nasm -o program.o -f elf program.asm
  • C) nasm -f bin program.asm -o program.o
  • D) nasm -f program.asm -o program.o

A) nasm -f elf64 program.asm

100

Scenario 7: Gina needs to manage data and control flow in NASM.

Which NASM directive reserves byte uninitialized space in the .bss section?

  • A) resb
  • B) db
  • C) dw
  • D) equ

B) db

100

Scenario 7: Gina needs to manage data and control flow in NASM.

Gina wants to reserve space for a 100-byte buffer. How should she write this directive in the .bss section?

  • A) resb 100
  • B) db 100
  • C) dw 100
  • D) times 100 db 0

A) resb 100

200

Scenario 6: Frank is dealing with macros in his NASM program.

Which directive should Frank use to define a macro in NASM?

  • A) %macro
  • B) MACRO
  • C) DEFINE
  • D) DEFINE_MACRO

A) %macro

200

Scenario 6: Frank is dealing with macros in his NASM program.

Frank wants to define a macro named ADD that adds two registers. How should he start this definition?

  • A) %macro ADD 2
  • B) ADD MACRO
  • C) DEFINE ADD
  • D) %define ADD

A) %macro ADD 2

200

Scenario 5: Emma needs to handle data in her NASM program.

Which section should Emma use to declare initialized data in her NASM source code?

  • A) .text
  • B) .code
  • C) .data
  • D) .bss

C) .data

200

Scenario 5: Emma needs to handle data in her NASM program.

Emma wants to define a constant string "Hello" in the .data section. Which directive should she use?

  • A) db 'Hello'
  • B) dw 'Hello'
  • C) resb 5
  • D) str 'Hello'

A) db 'Hello'

200

Scenario 4: David is setting up a simple "Hello, World!" program using NASM on Ubuntu.

Which section should David use to write the executable code for his NASM program?

  • A) .data
  • B) .text
  • C) .bss
  • D) .code

B) .text

300

Scenario 4: David is setting up a simple "Hello, World!" program using NASM on Ubuntu.

David wants to specify the entry point of his program. Which directive should he use in NASM?

  • A) ENTRY
  • B) START
  • C) global _start
  • D) begin

C) global _start

300

Scenario 3: Charlie needs to include an external file in his NASM program on Ubuntu.

Which directive should Charlie use to include an external file in his NASM source code?

  • A) IMPORT
  • B) EXTERN
  • C) INCLUDE
  • D) LIBRARY

C) INCLUDE

300

Scenario 3: Charlie needs to include an external file in his NASM program on Ubuntu.

Charlie wants to include an external file named utils.asm. How should he write this directive?

  • A) INCLUDE utils.asm
  • B) EXTERN utils.asm
  • C) IMPORT utils.asm
  • D) LIBRARY utils.asm

A) INCLUDE utils.asm

300

Scenario 2: Lina is writing a simple NASM assembly program on Ubuntu.

Which file extension is typically used for NASM source files in Ubuntu?

  • A) .asm
  • B) .nasm
  • C) .s
  • D) .text

A) .asm

300

Scenario 1: Alice is new to Ubuntu and wants to start programming in NASM.Which command should Alice use to install NASM on Ubuntu?

  • A) sudo apt-get install nasm
  • B) sudo yum install nasm
  • C) sudo pacman -S nasm
  • D) sudo dnf install nasm

A) sudo apt-get install nasm

400

Scenario 1: Alice is new to Ubuntu and wants to start programming in NASM.

Alice wants to check the version of NASM installed on her system. Which command should she use?

  • A) nasm --version
  • B) nasm -v
  • C) nasm -version
  • D) nasm --version-info

A) nasm --version

400

Scenario 10: Jack needs to use both macros and procedures in his assembly program.

When should Jack prefer to use a procedure over a macro?

  • A) When the code needs to be repeated multiple times.
  • B) When the code is small and used infrequently.
  • C) When the code is large and used frequently.
  • D) When the code does not involve conditional assembly.

C) When the code is large and used frequently.

400

Scenario 10: Jack needs to use both macros and procedures in his assembly program.

Jack wants to call a procedure named MYPROC from within a macro. How should he write the call within the macro?

  • A) CALL MYPROC
  • B) MYPROC MACRO
  • C) JMP MYPROC
  • D) MYPROC CALL

A) CALL MYPROC

400

Scenario 9: Irene wants to use macros to make her assembly code more readable and maintainable.

Which of the following is a limitation of using macros?

  • A) Macros cannot be recursive.
  • B) Macros always improve code performance.
  • C) Macros can only be used in the data segment.
  • D) Macros are slower than procedures.

A) Macros cannot be recursive.

400

Scenario 9: Irene wants to use macros to make her assembly code more readable and maintainable.

Irene wants to define a macro to swap the values of two registers. How should she start the macro definition?

  • A) SWAP PROC
  • B) SWAP EQU
  • C) SWAP MACRO
  • D) SWAP SEGMENT

C) SWAP MACRO

500

Scenario 8: Henry is using both far and near procedures in his assembly program.

Which instruction should Henry use to return from a near procedure?

  • A) RET
  • B) RETF
  • C) JMP
  • D) CALL

A) RET

500

Scenario 8: Henry is using both far and near procedures in his assembly program.

Henry needs to call a far procedure. What should he ensure about the code and data segments?

  • A) They must be identical.
  • B) They must be different.
  • C) They must be aligned.
  • D) They must be preloaded.

D) They must be preloaded.

500

Scenario 7: Gina is debugging her assembly code and needs to understand the behavior of macros.

What happens during the assembly process when a macro is called?

  • A) The macro code is executed immediately.
  • B) The macro code is expanded inline in place of the call.
  • C) The macro is compiled into a separate object file.
  • D) The macro is linked dynamically.

B) The macro code is expanded inline in place of the call.

500

Scenario 6: Frank is optimizing his code and needs to choose between near and far calls.

What is a primary benefit of using a near call over a far call?

  • A) Near calls allow access to other segments.
  • B) Near calls use less stack space and are faster.
  • C) Near calls can be used in macros.
  • D) Near calls do not affect segment registers.

 B) Near calls use less stack space and are faster.

500

Which register needs to be preserved when making a far call?

  • A) DS
  • B) CS
  • C) ES
  • D) AX

B) CS

M
e
n
u