1/22
Looks like no tags are added yet.
Name | Mastery | Learn | Test | Matching | Spaced | Call with Kai | Chat |
|---|
No analytics yet
Send a link to your students to track their progress
Variables
NASM provides various define directives for reserving storage space for __________.
[variable-name] define-directive initial-value [,initial-value]Syntax for storage allocation statement for initialized data.
DB
DW
DD
DQ
DT
Five basic forms of the define directive
DB
Define Byte (1 byte)
DW
Define Word (2 bytes)
DD
Define Doubleword (4 bytes)
DQ
Define Quadword (8 bytes)
DT
Define Ten Bytes (10 bytes)
Little-endian byte ordering
Processor uses the _______.
RESB
RESW
RESD
RESQ
REST
Used for reserving space for uninitialized data. Take a single operand that specifies the number of units of space to be reserved.
RESB
Reserve a Byte
RESW
Reserve a Word
RESD
Reserve a Doubleword
RESQ
Reserve a Quadword
REST
Reserve a Ten Bytes
Multiple Initializations
The TIMES directive allows multiple initializations to the same value.
Constants
There are several directives provided by NASM that define constants.
EQU
%assign
%define
Three directives
The EQU Directive
Used for defining constants.
CONSTANT_NAME EQU expressionThe syntax of the EQU directive
The %assign Directives
Can be used to define numeric constants like the EQU directive. This directive allows redefinition.
%assign TOTAL 10The example of the %assign Directive
The %define Directive
Allows defining both numeric and string constants. This directive is similar to the #define in C.