c-rl78.texi 3.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146
  1. @c Copyright (C) 2011-2015 Free Software Foundation, Inc.
  2. @c This is part of the GAS manual.
  3. @c For copying conditions, see the file as.texinfo.
  4. @ifset GENERIC
  5. @page
  6. @node RL78-Dependent
  7. @chapter RL78 Dependent Features
  8. @end ifset
  9. @ifclear GENERIC
  10. @node Machine Dependencies
  11. @chapter RL78 Dependent Features
  12. @end ifclear
  13. @cindex RL78 support
  14. @menu
  15. * RL78-Opts:: RL78 Assembler Command Line Options
  16. * RL78-Modifiers:: Symbolic Operand Modifiers
  17. * RL78-Directives:: Assembler Directives
  18. * RL78-Syntax:: Syntax
  19. @end menu
  20. @node RL78-Opts
  21. @section RL78 Options
  22. @cindex options, RL78
  23. @cindex RL78 options
  24. @table @code
  25. @item relax
  26. Enable support for link-time relaxation.
  27. @item mg10
  28. Mark the generated binary as targeting the G10 variant of the RL78
  29. architecture.
  30. @item mg13
  31. Mark the generated binary as targeting the G13 variant of the RL78
  32. architecture.
  33. @item mg14
  34. @itemx mrl78
  35. Mark the generated binary as targeting the G14 variant of the RL78
  36. architecture. This is the default.
  37. @item m32bit-doubles
  38. Mark the generated binary as one that uses 32-bits to hold the
  39. @code{double} floating point type. This is the default.
  40. @item m64bit-doubles
  41. Mark the generated binary as one that uses 64-bits to hold the
  42. @code{double} floating point type.
  43. @end table
  44. @node RL78-Modifiers
  45. @section Symbolic Operand Modifiers
  46. @cindex RL78 modifiers
  47. @cindex syntax, RL78
  48. The RL78 has three modifiers that adjust the relocations used by the
  49. linker:
  50. @table @code
  51. @item %lo16()
  52. When loading a 20-bit (or wider) address into registers, this modifier
  53. selects the 16 least significant bits.
  54. @smallexample
  55. movw ax,#%lo16(_sym)
  56. @end smallexample
  57. @item %hi16()
  58. When loading a 20-bit (or wider) address into registers, this modifier
  59. selects the 16 most significant bits.
  60. @smallexample
  61. movw ax,#%hi16(_sym)
  62. @end smallexample
  63. @item %hi8()
  64. When loading a 20-bit (or wider) address into registers, this modifier
  65. selects the 8 bits that would go into CS or ES (i.e. bits 23..16).
  66. @smallexample
  67. mov es, #%hi8(_sym)
  68. @end smallexample
  69. @end table
  70. @node RL78-Directives
  71. @section Assembler Directives
  72. @cindex assembler directives, RL78
  73. @cindex RL78 assembler directives
  74. In addition to the common directives, the RL78 adds these:
  75. @table @code
  76. @item .double
  77. Output a constant in ``double'' format, which is either a 32-bit
  78. or a 64-bit floating point value, depending upon the setting of the
  79. @option{-m32bit-doubles}|@option{-m64bit-doubles} command line
  80. option.
  81. @item .bss
  82. Select the BSS section.
  83. @item .3byte
  84. Output a constant value in a three byte format.
  85. @item .int
  86. @itemx .word
  87. Output a constant value in a four byte format.
  88. @end table
  89. @node RL78-Syntax
  90. @section Syntax for the RL78
  91. @menu
  92. * RL78-Chars:: Special Characters
  93. @end menu
  94. @node RL78-Chars
  95. @subsection Special Characters
  96. @cindex line comment character, RL78
  97. @cindex RL78 line comment character
  98. The presence of a @samp{;} appearing anywhere on a line indicates the
  99. start of a comment that extends to the end of that line.
  100. If a @samp{#} appears as the first character of a line then the whole
  101. line is treated as a comment, but in this case the line can also be a
  102. logical line number directive (@pxref{Comments}) or a preprocessor
  103. control command (@pxref{Preprocessing}).
  104. @cindex line separator, RL78
  105. @cindex statement separator, RL78
  106. @cindex RL78 line separator
  107. The @samp{|} character can be used to separate statements on the same
  108. line.