您的位置:首页 > 其它

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".
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签:  structure float string byte