Chapter 4 - Requirements For Coding in Assembly Language
Chapter 4 - Requirements For Coding in Assembly Language
Chapter Outline
Assembly Language Features
Simplified segment Directive
Defining Types of data
Equate Directive
Dn
Dn
expression
expression
Pseudo-op
Stands for
DB
DW
DD
DQ
DT
Define Byte
Define Word
Define Doubleword
Define Quadword
Define Tenbytes
DB initial_value
Example:
ALPHA DB 4
BYT
WRD
DB ?
DW -2
Address
B_ARRAY
B_ARRAY+1
B_ARRAY+2
200H
201H
202H
Contents
10H
20H
30H
Symbol
Address
W_ARRAY
0300H
W_ARRAY+2 0302H
W_ARRAY+4 0304H
W_ARRAY+6 0306H
Contents
1000D
40D
29887D
329D
Example:
DELTA DB
Dn
Repeat-count(exp)
DW
1234H
high byte
WORD1+1
low byte
WORD1
Character String
ASCII codes can be initialized with a string of
characters using single quotes like PC or double quotes like PC.
Example:
LETTERS DB
=
LETTERS DB
'ABC'
41H,42H,43H
Numeric Constant
In an assembly language program we may express data as:
Binary: bit string followed by B or b
Decimal: string of decimal digits followed by an optional D or
d
Hex: begins with a decimal digit and ends with H or h
Real : end with R and the assembler converts a given a
decimal or hex constant to floating point number
Any number may have an optional sign.
11
Numeric Constant
Number
Type
11011
1101B
64223
-21843D
1,234
1B4DH
1B4D
FFFFH
0FFFFH
decimal
binary
decimal
decimal
illegal
hex
illegal
illegal
hex
12