February 9

x86 Assembly Data Types

0  comments

x86 data types is a little bit different from MIPS assembly data type explained previously. 8086 data types have similar functionality but they are a little bit different in syntax.

These variable types are explained below:

See the table for the list of data type 8086 architecture offers.

Pseudo-operation Stand For
DB Define Byte
DW Define Word
DD Define Doubleword
DQ Define Quadword
DT Define Ten Byte

In addition to these data types, there is variable representation against each data type.

Variable Types in 8086 Assembly

Variable play same role in assembly language as in high-level languages. Each variable has a data type and assigned a space in memory. Variable types in x86 are explained below:

Byte Variable in x86

DECIMAL RANGE FOR BYTE VARIABLE
Signed Interpretation -128 to 127
Unsigned Interpretation 0 to 255

Byte variable has the following general form:

name   DB                                   initial_value

We have a variable name, DB stands for “Define Byte” and an initial value of a variable. See the example below in which a byte variable is initialized.

variable1   DB                            23

In the above example, the variable name is “varibale1” and its value is “23”. when you only need to declare a variable use a question mark(?) instead of a value.

variable   DB                              ?

Word Variable in x86

DECIMAL RANGE FOR WORD VARIABLE
Signed Interpretation -32768 to 32767
Unsigned Interpretation 0 to 65535

DW is used for a word variable. Its Basic form is as follows:

name DW                                 initial_value

It is 32 bit so you can also use signed value as given below:

variable DW                                 -23

Ask your problems in the comment box below.


Tags


You may also like

How Smart Manufacturing is Transforming the Industry

How Smart Manufacturing is Transforming the Industry