Module 3.4: Assembly - Variables and Constant

0.0(0)
Studied by 0 people
call kaiCall Kai
Locked
learnLearn
examPractice Test
spaced repetitionSpaced Repetition
heart puzzleMatch
flashcardsFlashcards
GameKnowt Play
Card Sorting

1/22

encourage image

There's no tags or description

Looks like no tags are added yet.

Last updated 9:51 AM on 9/8/26
Name
Mastery
Learn
Test
Matching
Spaced
Call with Kai
Chat

No analytics yet

Send a link to your students to track their progress

23 Terms

1
New cards

Variables

NASM provides various define directives for reserving storage space for __________.

2
New cards
[variable-name]    define-directive    initial-value   [,initial-value]


Syntax for storage allocation statement for initialized data.

3
New cards

DB
DW
DD
DQ
DT

Five basic forms of the define directive

4
New cards

DB

Define Byte (1 byte)

5
New cards

DW

Define Word (2 bytes)

6
New cards

DD

Define Doubleword (4 bytes)

7
New cards

DQ

Define Quadword (8 bytes)

8
New cards

DT

Define Ten Bytes (10 bytes)

9
New cards

Little-endian byte ordering

Processor uses the _______.

10
New cards

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.

11
New cards

RESB

Reserve a Byte

12
New cards

RESW

Reserve a Word

13
New cards

RESD

Reserve a Doubleword

14
New cards

RESQ

Reserve a Quadword

15
New cards

REST

Reserve a Ten Bytes

16
New cards

Multiple Initializations

The TIMES directive allows multiple initializations to the same value.

17
New cards

Constants

There are several directives provided by NASM that define constants.

18
New cards

EQU
%assign
%define

Three directives

19
New cards

The EQU Directive

Used for defining constants.

20
New cards
CONSTANT_NAME EQU expression


The syntax of the EQU directive

21
New cards

The %assign Directives

Can be used to define numeric constants like the EQU directive. This directive allows redefinition.

22
New cards
%assign TOTAL 10


The example of the %assign Directive

23
New cards

The %define Directive

Allows defining both numeric and string constants. This directive is similar to the #define in C.