13.07.2015 Views

TASKING VX-toolset for ARM User Guide

TASKING VX-toolset for ARM User Guide

TASKING VX-toolset for ARM User Guide

SHOW MORE
SHOW LESS

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

Assembly Language.DB, .DH, .DW, .DDSyntax[label] .DB argument[,argument]...[label] .DH argument[,argument]...[label] .DW argument[,argument]...[label] .DD argument[,argument]...DescriptionWith these directive you can define memory. With each directive the assembler allocates and initializesone or more bytes of memory <strong>for</strong> each argument.If you specify the optional label, it gets the value of the location counter at the start of the directiveprocessing.An argument can be a single- or multiple-character string constant, an expression or empty. Multiplearguments must be separated by commas with no intervening spaces. Empty arguments are stored as0 (zero).The following table shows the number of bits initialized.Directive.DB.DH.DW.DDBits8163264The value of the arguments must be in range with the size of the directive; floating-point numbers are notallowed. If the evaluated argument is too large to be represented in a half word / word / double-word, theassembler issues a warning and truncates the value.String constantsSingle-character strings are stored in a byte whose lower seven bits represent the ASCII value of thecharacter, <strong>for</strong> example:.DB 'R'; = 0x52Multiple-character strings are stored in consecutive byte addresses, as shown below. The standard Clanguage escape characters like ‘\n’ are permitted..DB 'AB',,'C' ; = 0x41420043 (second argument is empty)ExampleWhen a string is supplied as argument of a directive that initializes multiple bytes, each character in thestring is stored in consecutive bytes whose lower seven bits represent the ASCII value of the character.For example:105

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!