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?
C) .bss
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
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
Scenario 7: Gina needs to manage data and control flow in NASM.
Which NASM directive reserves byte uninitialized space in the .bss section?
B) db
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
Scenario 6: Frank is dealing with macros in his NASM program.
Which directive should Frank use to define a macro in NASM?
A) %macro
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
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?
C) .data
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'
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?
B) .text
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?
C) global _start
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?
C) INCLUDE
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
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
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
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
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?
C) When the code is large and used frequently.
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
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.
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?
C) SWAP MACRO
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
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?
D) They must be preloaded.
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?
B) The macro code is expanded inline in place of the call.
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?
B) Near calls use less stack space and are faster.
Which register needs to be preserved when making a far call?
B) CS