chapter 3 -Assembly Language Fundamentals Flashcards
Assembly language statements are divided into:
A) Procedures and Functions
B) Instructions and Directives
C) Loops and Conditions
D) Labels and Mnemonics
B) Instructions and Directives
Which of the following is an executable instruction?
A) TITLE
B) BYTE
C) MOV
D) END
C) MOV
Directives in assembly language:
A) Generate machine code
B) Allocate storage or define segments
C) Are executed at runtime
D) Are not case sensitive
B) Allocate storage or define segments
What does PROC indicate in assembly language?
A) Start of a code segment
B) End of a program
C) Start of a procedure
D) End of a data segment
C) Start of a procedure
Which directive specifies the end of the program?
A) END
B) TITLE
C) DATA
D) CODE
A) END
In a program template, the .code segment is:
A) Writable and executable
B) Only writable
C) Executable but read-only
D) Used for data declaration
C) Executable but read-only
The MOV instruction is used for:
A) Arithmetic operations
B) Transferring data
C) Subtracting data
D) Comparing values
B) Transferring data
What does the CALL instruction do?
A) Transfers control to a procedure
B) Compares two values
C) Moves data between registers
D) Sets flags in the CPU
A) Transfers control to a procedure
A two-operand instruction format includes:
A) Label, mnemonic, operand
B) Mnemonic, two operands, comment
C) Label, comment, data
D) Mnemonic, operand, directive
B) Mnemonic, two operands, comment
A WORD in assembly language refers to:
A) 1 byte
B) 2 bytes
C) 4 bytes
D) 8 bytes
B) 2 bytes
Which of these defines a signed 8-bit value?
A) BYTE
B) SBYTE
C) DWORD
D) QWORD
B) SBYTE
A string in assembly language is:
A) A null-terminated array of characters
B) A sequence of integers
C) A register containing characters
D) Limited to 4 characters
A) A null-terminated array of characters
The DUP operator is used to:
A) Define a procedure
B) Allocate space for an array
C) Compare two operands
D) Access memory addresses
B) Allocate space for an array
A symbolic constant is defined using:
A) BYTE
B) EQU
C) PROC
D) DATA
B) EQU
What does the $ operator represent in assembly language?
A) Start of a data segment
B) Current memory location
C) End of a procedure
D) Address of the next instruction
B) Current memory location
What is the purpose of DumpRegs?
A) Allocate registers
B) Display register contents
C) Clear register values
D) Initialize flags
B) Display register contents
Which instruction is used to add two values in assembly?
A) MOV
B) CALL
C) ADD
D) DUP
C) ADD
What is the first step in the assemble-link-execute cycle?
A) Debugging the code
B) Compiling the program
C) Writing the source program
D) Executing the machine code
C) Writing the source program
In Little Endian systems, the least significant byte is stored:
A) At the highest memory address
B) At the lowest memory address
C) In the middle of memory
D) In registers only
B) At the lowest memory address
What does the QWORD data type define?
A) 8-bit data
B) 16-bit data
C) 32-bit data
D) 64-bit data
D) 64-bit data
What is the difference between an instruction and a directive?
An instruction is executable and generates machine code, while a directive provides information to the assembler (e.g., to allocate memory or define segments).
What does the DUP operator do in assembly?
The DUP operator creates space for arrays or strings by duplicating a value or initializer.
Define a null-terminated string in assembly language.
A null-terminated string is an array of characters followed by a 0 byte to indicate the end of the string.
What is the purpose of the .data segment in an assembly program?
The .data segment is used for declaring and initializing variables and storing static data.
What is the significance of Little Endian order?
In Little Endian systems, the least significant byte is stored at the lowest memory address, reversing the order of multi-byte values.
Explain the purpose of DumpRegs.
DumpRegs displays the contents of all CPU registers and flags, useful for debugging.
How is a WORD defined in assembly language?
A WORD is a 16-bit data type, typically used for storing small integers or addresses.
What does the EQU directive do?
The EQU directive assigns a symbolic constant to a value or expression, allowing for easier readability and maintenance.
What is the purpose of the CALL instruction?
The CALL instruction transfers control to a procedure, saving the return address for later execution.