A
B
C
D
E
100

Scenario 1: Alex is writing an assembly language program and needs to define a constant value for the length of an array.

  1. Which assembler directive should Alex use to define a constant value?
    • A) EQU
    • B) DB
    • C) ORG
    • D) END

A) EQU

100

Scenario 1: Alex is writing an assembly language program and needs to define a constant value for the length of an array.

  1. Alex wants to ensure the constant value is named LENGTH. How should he write this directive?
    • A) LENGTH DB 10
    • B) LENGTH EQU 10
    • C) LENGTH ORG 10
    • D) LENGTH END 10

B) LENGTH EQU 10

100

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?

  • A) EQU
  • B) DB
  • C) ORG
  • D) DW

B) DB

100

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
  • B) ARRAY DW 1, 2, 3
  • C) ARRAY EQU 1, 2, 3
  • D) ARRAY ORG 1, 2, 3

A) ARRAY DB 1, 2, 3

100

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?

  • A) EQU
  • B) DB
  • C) ORG
  • D) END

C) ORG

200

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
  • B) EQU 1000h
  • C) DB 1000h
  • D) DW 1000h

A) ORG 1000h

200

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?

  • A) CODE
  • B) DATA
  • C) ORG
  • D) DB

B) DATA

200

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?

  • A) DB 1234h
  • B) DW 1234h
  • C) EQU 1234h
  • D) ORG 1234h

B) DW 1234h

200

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) ;
  • B) #
  • C) //
  • D) --

A) ;

200

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?

  • A) MOV AX, 0x1234 // Initialize AX
  • B) MOV AX, 0x1234 # Initialize AX
  • C) MOV AX, 0x1234 ; Initialize AX
  • D) MOV AX, 0x1234 -- Initialize AX

C) MOV AX, 0x1234 ; Initialize AX

300

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:
  • B) LABEL EQU
  • C) LABEL ORG
  • D) LABEL DB

A) LABEL:

300

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
  • B) EXTERN
  • C) ORG
  • D) DB

A) INCLUDE

300

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
  • B) CODE
  • C) ORG
  • D) EQU

A) SEGMENT

300

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?

  • A) DB
  • B) DW
  • C) RESB
  • D) EQU

C) RESB

300

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
  • B) DB 10
  • C) DW 10
  • D) EQU 10

A) RESB 10

400

Scenario 1: Alex is writing an assembly program that calls a procedure located in the same code segment.

  1. Which type of procedure call should Alex use for a procedure within the same code segment?
    • A) Far call
    • B) Near call
    • C) Macro call
    • D) External call

B) Near call

400

Scenario 1: Alex is writing an assembly program that calls a procedure located in the same code segment.

  1. What is a key characteristic of a near procedure call?
    • A) It includes the segment address.
    • B) It uses only the offset address.
    • C) It can call procedures in other segments.
    • D) It requires a larger instruction size.

B) It uses only the offset address.

400

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
  • B) Near call
  • C) Macro call
  • D) Inline call

A) Far call

400

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?

  • A) PROC
  • B) END
  • C) MACRO
  • D) SEGMENT

C) MACRO

400

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?

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

 B) CS

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

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?

  • A) The procedures must be in different segments.
  • B) The procedures must be in the same segment.
  • C) The procedures must be macros.
  • D) The procedures must use the same register values.

B) The procedures must be in the same segment.

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 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 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
  • B) .nasm
  • C) .s
  • D) .text

A) .asm