Scenario 1: Alex is writing an assembly language program and needs to define a constant value for the length of an array.
A) EQU
Scenario 1: Alex is writing an assembly language program and needs to define a constant value for the length of an array.
B) LENGTH EQU 10
Scenario 2: Brian needs to allocate memory for a byte array in his assembly program.
Which assembler directive should Brian use to allocate a block of memory for the byte array?
B) DB
Scenario 2: Brian needs to allocate memory for a byte array in his assembly program.
Brian wants to initialize an array with the values 1, 2, and 3. Which directive should he use?
A) ARRAY DB 1, 2, 3
Scenario 3: Cindy is working on an assembly program where she needs to specify the starting address of her code.
1. Which assembler directive should Cindy use to set the starting address of her code?
C) ORG
Scenario 3: Cindy is working on an assembly program where she needs to specify the starting address of her code.
Cindy wants to start her code at address 1000h. How should she write this directive?
A) ORG 1000h
Scenario 4: David is defining a data section in his assembly program.
Which directive is typically used to mark the beginning of a data section?
B) DATA
Scenario 4: David is defining a data section in his assembly program.
David wants to define a word (2 bytes) variable initialized to the value 1234h. Which directive should he use?
B) DW 1234h
Scenario 5: Emma needs to include comments in her assembly code to make it more understandable.
Which symbol is commonly used to start a comment in assembly language?
A) ;
Scenario 5: Emma needs to include comments in her assembly code to make it more understandable.
Emma wants to comment on the initialization of a register. How should she write this?
C) MOV AX, 0x1234 ; Initialize AX
Scenario 6: Frank needs to define a label for a loop in his assembly program.
Which assembler directive or syntax is used to define a label?
A) LABEL:
Scenario 7: Gina needs to include an external file in her assembly program.
Which directive should Gina use to include an external file?
A) INCLUDE
Scenario 9: Irene needs to define a segment for her code in assembly language.
Which assembler directive is used to define a code segment?
A) SEGMENT
Scenario 10: Jack is working on a program where he needs to reserve uninitialized memory space.
Which assembler directive reserves a specified amount of uninitialized memory?
C) RESB
Scenario 10: Jack is working on a program where he needs to reserve uninitialized memory space.
Jack wants to reserve 10 bytes of uninitialized memory. How should he write this directive?
A) RESB 10
Scenario 1: Alex is writing an assembly program that calls a procedure located in the same code segment.
B) Near call
Scenario 1: Alex is writing an assembly program that calls a procedure located in the same code segment.
B) It uses only the offset address.
Scenario 2: Brian needs to call a procedure located in a different code segment.
Which type of procedure call should Brian use for a procedure in a different code segment?
A) Far call
Scenario 3: Cindy wants to use a macro to simplify her code.
Cindy defines a macro named SUM to add two numbers. Which directive should she use to define it?
C) MACRO
Scenario 4: David is working on a project with multiple procedures, some of which are far and some near.
Which register needs to be preserved when making a far call?
B) CS
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.
Scenario 6: Frank is optimizing his code and needs to choose between near and far calls.
Frank decides to convert some far calls to near calls. What must be true for this to be possible?
B) The procedures must be in the same segment.
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 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 2: Bob is writing a simple NASM assembly program on Ubuntu.
Which file extension is typically used for NASM source files in Ubuntu?
A) .asm