HomeComputer programmingAssembly: Define Directives

Assembly: Define Directives

The size and reason for defining different sized parameters is discussed in this tech-recipes tutorial.

DB: Define Byte ;allocates 1 byte
DW: Define Word ;allocates 2 bytes
DD: Define Doubleword ;allocates 4 bytes
DQ: Define Quadword ;allocates 8 bytes
DT: Define Ten bytes ;allocates 10 bytes

Keep in mind that Assembly does not actually care about words, but rather the number of bytes. To define a string, DW is used to ensure enough space is reserved (though space is not reserved the same way as it is in high level languages).

These directives would be used to declare variables in the following manner in the .DATA section of your program.

sorted DB ’y’
empty DB ? ;no initialization
number DW 25159
float DD 1.234

Questions/Comments: [email protected]
-William. § (marvin_gohan)



Please enter your comment!
Please enter your name here

- Advertisment -

Most Popular

Recent Comments

Cleveland Furia on How to Clear Google Activity
Sid Wohlfarth on How to Clear Google Activity
Riley Magsayo on How to Clear Google Activity
สมัครรับเครดิตฟรี ทันที on How to improve Remote Desktop Protocol Performance
Neal Wangstad on How to Clear Google Activity
Slavcho Andov on How to install Ubuntu
Slavcho Andov on How to fix bad sectors
Sheraz Ali on How to Backup Android