June 28th Thursday (六月 二十八日 木曜日)
2007-07-14 11:44
531 查看
In ARM pseudo-instruction, some can be used to allocalte and initialize a block of memory units.
DCB - to allocate a block of "byte" type memory units and to initialize them by specified data.
DCB is also replaced by "=".
DCW{U} - to allocate a block of "half-word"(two bytes) type memory units and to initialize them by specified data.
if with "U", those allocated memory units is not aligned.
DCD{U} - to allocate a block of "word"(four bytes) type memory units and to initialize them by specified data.
if with "U", those allocated memory units is not aligned. DCD is also replaced by "&".
DCFD{U} - to allocate a block of "double float" type memory units and to initialize them by specified data.
if with "U", those allocated memory units is not aligned.
DCFS{U} - to allocate a block of "single float" type memory units and to initialize them by specified data.
if with "U", those allocated memory units is not aligned.
DCQ{U} - to allocate a block of "8 bytes" type memory units and to initialize them by specified data.
if with "U", those allocated memory units is not aligned.
SPACE - to allocate a block of sequential memory units an to initialize with 0.
Format: Label SPACE expression
DataSpace SPACE 100
MAP and FIELD
MAP/^ expression{, base_register}
The MAP is used to define a start address of a structure memory table. If the "base_register" is ignored,
the value of "expression" is considered as the start address of a structure; otherwise, the start address of
a structure is the sum of the value of "expression" and the value of "base_register".
MAP 0x100, R0
Label FIELD/# expression
The FIELD is used to define a data field in a structure. The value of "expression" tell how many bytes
is occupied. It usually is used with MAP.
Notice: The above twp pesudo-instruction just declare a structure and do not allocate memory.
MAP 0x100
A FIELD 16 ; at 0x100
B FIELD 32 ; at 0x110
S FIELD 256 ; at 0x130
How to define a macro?
$Label Macro_name $arg1, $arg2, ...
codes...
MEND
There is a MEXIT can escape out from a macro body.
There are some useful operators.
?X
The "?" can return the length of the executable from the expression "X".
: DEF: X
To test whether a symbol "X" is defined.
: STR: X
To convert a number expression or boolean expression into a string. For number, the
"STR" just convert it to a hexadecimal numeric string; for boolean expression, convert
it to "T" or "F" string.
X: LEFT: Y / X: RIGHT: Y
To get a sub-string from the left or the right of "X", "Y" specify the number of
characters.
X: CC: Y
To append "Y" into "X".
DCB - to allocate a block of "byte" type memory units and to initialize them by specified data.
DCB is also replaced by "=".
DCW{U} - to allocate a block of "half-word"(two bytes) type memory units and to initialize them by specified data.
if with "U", those allocated memory units is not aligned.
DCD{U} - to allocate a block of "word"(four bytes) type memory units and to initialize them by specified data.
if with "U", those allocated memory units is not aligned. DCD is also replaced by "&".
DCFD{U} - to allocate a block of "double float" type memory units and to initialize them by specified data.
if with "U", those allocated memory units is not aligned.
DCFS{U} - to allocate a block of "single float" type memory units and to initialize them by specified data.
if with "U", those allocated memory units is not aligned.
DCQ{U} - to allocate a block of "8 bytes" type memory units and to initialize them by specified data.
if with "U", those allocated memory units is not aligned.
SPACE - to allocate a block of sequential memory units an to initialize with 0.
Format: Label SPACE expression
DataSpace SPACE 100
MAP and FIELD
MAP/^ expression{, base_register}
The MAP is used to define a start address of a structure memory table. If the "base_register" is ignored,
the value of "expression" is considered as the start address of a structure; otherwise, the start address of
a structure is the sum of the value of "expression" and the value of "base_register".
MAP 0x100, R0
Label FIELD/# expression
The FIELD is used to define a data field in a structure. The value of "expression" tell how many bytes
is occupied. It usually is used with MAP.
Notice: The above twp pesudo-instruction just declare a structure and do not allocate memory.
MAP 0x100
A FIELD 16 ; at 0x100
B FIELD 32 ; at 0x110
S FIELD 256 ; at 0x130
How to define a macro?
$Label Macro_name $arg1, $arg2, ...
codes...
MEND
There is a MEXIT can escape out from a macro body.
There are some useful operators.
?X
The "?" can return the length of the executable from the expression "X".
: DEF: X
To test whether a symbol "X" is defined.
: STR: X
To convert a number expression or boolean expression into a string. For number, the
"STR" just convert it to a hexadecimal numeric string; for boolean expression, convert
it to "T" or "F" string.
X: LEFT: Y / X: RIGHT: Y
To get a sub-string from the left or the right of "X", "Y" specify the number of
characters.
X: CC: Y
To append "Y" into "X".
相关文章推荐
- June 7th Thursday (六月 七日 木曜日)
- 2008 February 28th Thursday (二月 二十八日 木曜日)
- 2008 August 28th Thursday (八月 二十八日 木曜日)
- June 11th Thursday (六月 十一日 木曜日)
- June 14th Thursday (六月 十四日 木曜日)
- June 25th Thursday (六月 二十五日 木曜日)
- June 4th Thursday (六月 四日 木曜日)
- June 18th Tuesday (六月 十八日 木曜日)
- June 21th Thursday (六月 二十一日 木曜日)
- June 19th Friday (六月 十九日 木曜日)
- May 28th Tuesday (五月 二十八日 木曜日)
- March 8th Thursday (三月 八日 木曜日)
- Aprial 12th Thursday (四月 十二日 木曜日)
- June 20th Wednesday (六月 二十日 水曜日)
- July 12th Thursday (七月 十二日 木曜日)
- August 30th Thursday (八月 三十日 木曜日)
- October 18th Thursday (十月 十八日 木曜日)
- 2008 February 14th Thursday (二月 十四日 木曜日)
- 2008 May 15th Thursday (五月 十五日 木曜日)
- 2008 July 31th Thursday (七月 三十一日 木曜日)