Download TR0129 MicroBlaze Embedded Tools Reference

Transcript
MicroBlaze Embedded Tools Reference
.BS/.BSB/.BSH/.BSW/.BSD
Syntax
[label] .BS expression1[,expression2]
[label] .BSB expression1[,expression2]
[label] .BSH expression1[,expression2]
[label] .BSW expression1[,expression2]
[label] .BSD expression1[,expression2]
Description
With the .BS directive (Block Storage) the assembler reserves a block of memory. The reserved block of memory is initialized to
the value of expression2, or zero if omitted.
With expression1 you specify the number of minimum addressable units (MAUs) you want to reserve, and how much the
location counter will advance. The expression must be an integer greater than zero and cannot contain any forward references
to address labels (labels that have not yet been defined).
With expression2 you can specify a value to initialize the block with. Only the least significant MAU of expression2 is used. If
you omit expression2, the default is zero.
If you specify label, it gets the value of the location counter at the start of the directive processing.
Initialization of a block of memory only happens in sections with section attribute init or romdata. In other sections, the
assembler issues a warning and only reserves space, just as with .DS.
The .BSB, .BSH, .BSW and .BSD directives are variants of the .BS directive:
.BSB
The expression1 argument specifies the number of bytes to reserve.
.BSH
The expression1 argument specifies the number of half words to reserve (one half word is16 bits).
.BSW
The expression1 argument specifies the number of words to reserve (one word is 32 bits).
.BSD
The expression1 argument specifies the number of double−words to reserve (one double−word is 64 bits).
Example
The .BSB directive is for example useful to define and initialize an array that is only partially filled:
.section .sdata
.DB 84,101,115,116
.BSB 96,0xFF
Related information
.DS
3−12
(Define Storage)
; initialize 4 bytes
; reserve another 96 bytes, initialized with 0xFF