8051 DATA
TYPES AND
DIRECTIVES
Assembler
Directives
􀂉 The DB directive is the most widely
used data directive in the assembler
􀂾 It is used to define the 8-bit data
􀂾 When DB is used to define data, the
numbers can be in decimal, binary, hex,
ASCII formats
ORG 500H
DATA1: DB 28 ;DECIMAL (1C in Hex)
DATA2: DB 00110101B ;BINARY (35 in Hex)
DATA3: DB 39H ;HEX
ORG 510H
DATA4: DB “2591” ;ASCII NUMBERS
ORG 518H
DATA6: DB “My name is Joe”
;ASCII CHARACTERS
The “D” after the decimal
number is optional, but using
“B” (binary) and “H”
(hexadecimal) for the others is
required
The Assembler will
convert the numbers
into hex
Place ASCII in quotation marks
The Assembler will assign ASCII
code for the numbers or characters
Define ASCII strings larger
than two characters

Post a Comment

0 Comments

Close Menu