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: william_a_wilson@hotmail.com
-William. § (marvin_gohan)



Please enter your comment!
Please enter your name here

- Advertisment -

Most Popular

Recent Comments

error: Content is protected !!