summaryrefslogtreecommitdiff
path: root/gas/doc
diff options
context:
space:
mode:
authorSergey Belyashov <sergey.belyashov@gmail.com>2020-01-14 13:13:57 +0000
committerNick Clifton <nickc@redhat.com>2020-01-14 13:13:57 +0000
commit7a6bf3becbe3e0ce47d2681edcfe7adcb67fe4e2 (patch)
treea164f68d854f21e3f5b27109be9e88f69fbf7fdb /gas/doc
parentef4e5ba50c76511d4306edf1526c15269f1d7747 (diff)
downloadbinutils-gdb-7a6bf3becbe3e0ce47d2681edcfe7adcb67fe4e2.tar.gz
Fix various assembler testsuite failures for the Z80 target.
PR 25377 gas * config/tc-z80.c: Add support for half precision, single precision and double precision floating point values. * config/tc-z80.h b/gas/config/tc-z80.h: Disable string escapes. * doc/as.texi: Add new z80 command line options. * doc/c-z80.texi: Document new z80 command line options. * testsuite/gas/z80/ez80_pref_dis.s: New test. * testsuite/gas/z80/ez80_pref_dis.d: New test driver. * testsuite/gas/z80/z80.exp: Run the new test. * testsuite/gas/z80/fp_math48.d: Use correct command line option. * testsuite/gas/z80/fp_zeda32.d: Likewise. * testsuite/gas/z80/strings.d: Update expected output. opcodes * z80-dis.c (suffix): Use .db instruction to generate double prefix.
Diffstat (limited to 'gas/doc')
-rw-r--r--gas/doc/as.texi85
-rw-r--r--gas/doc/c-z80.texi139
2 files changed, 121 insertions, 103 deletions
diff --git a/gas/doc/as.texi b/gas/doc/as.texi
index ab661a73dbe..fa155096159 100644
--- a/gas/doc/as.texi
+++ b/gas/doc/as.texi
@@ -631,6 +631,11 @@ gcc(1), ld(1), and the Info entries for @file{binutils} and @file{ld}.
@emph{Target Z80 options:}
[@b{-z80}]|[@b{-z180}]|[@b{-r800}]|[@b{-ez80}]|[@b{-ez80-adl}]
+ [@b{-local-prefix=}@var{PREFIX}]
+ [@b{-colonless}]
+ [@b{-sdcc}]
+ [@b{-fp-s=}@var{FORMAT}]
+ [@b{-fp-d=}@var{FORMAT}]
[@b{-strict}]|[@b{-full}]
[@b{-with-inst=@var{INST}[,...]}] [@b{-Wnins @var{INST}[,...]}]
[@b{-without-inst=@var{INST}[,...]}] [@b{-Fins @var{INST}[,...]}]
@@ -1940,78 +1945,24 @@ Xtensa processor.
@end ifset
-@c man begin OPTIONS
-
@ifset Z80
-The following options are available when @value{AS} is configured for
-a Z80 family processor.
-@table @gcctabopt
-@item -z80
-Assemble for Z80 processor.
-@item -r800
-Assemble for R800 processor.
-@item -z180
-Assemble for Z180 processor.
-@item -ez80
-Assemble for eZ80 processor in Z80 memory mode by default.
-@item -ez80-adl
-Assemble for eZ80 processor in ADL memory mode by default.
-
-@item @code{-colonless}
-Accept colonless labels. All names at line begin are treated as labels.
-@item @code{-sdcc}
-Accept assembler code produces by SDCC.
-
-@item @code{-strict}
-Accept documented instructions only.
-@item @code{-full}
-Accept all known Z80 instructions.
-@item @code{-with-inst=INST[,...]}
-@itemx @code{-Wnins INST[,...]}
-Enable specified undocumented instruction(s).
-@item @code{-without-inst=INST[,...]}
-@itemx @code{-Fins INST[,...]}
-Disable specified undocumented instruction(s).
-
-@item -ignore-undocumented-instructions
-@itemx -Wnud
-Assemble undocumented Z80 instructions that also work on R800 without warning.
-@item -ignore-unportable-instructions
-@itemx -Wnup
-Assemble all undocumented Z80 instructions without warning.
-@item -warn-undocumented-instructions
-@itemx -Wud
-Issue a warning for undocumented Z80 instructions that also work on R800.
-@item -warn-unportable-instructions
-@itemx -Wup
-Issue a warning for undocumented Z80 instructions that do not work on R800.
-@item -forbid-undocumented-instructions
-@itemx -Fud
-Treat all undocumented instructions as errors.
-@item -forbid-unportable-instructions
-@itemx -Fup
-Treat undocumented Z80 instructions that do not work on R800 as errors.
-@end table
+@ifclear man
+@xref{Z80 Options}, for the options available when @value{AS} is configured
+for an Z80 processor.
+@end ifclear
-Folowing undocumented instructions may be enabled/disabled by
-@code{-with-inst}/@code{-without-inst}:
-@table @gcctabopt
-@item @code{idx-reg-halves}
-All operations with halves of index registers (IXL, IXH, IYL, IYH).
-@item @code{sli}
-SLI or SLL instruction.
-@item @code{op-ii-ld}
-Istructions like @code{<op> (<ii>+<d>),<r>}, where @code{<op>}
-is shift or bit manipulation instruction (RLC, SLA, SET, RES...).
-@item @code{in-f-c}
-Instruction @code{IN F,(C)}.
-@item @code{out-c-0}
-Instruction @code{OUT (C),0}
-@end table
+@ifset man
+@c man begin OPTIONS
+The following options are available when @value{AS} is configured for an
+Z80 processor.
+@c man end
+@c man begin INCLUDE
+@include c-z80.texi
+@c ended inside the included file
@end ifset
-@c man end
+@end ifset
@menu
* Manual:: Structure of this Manual
diff --git a/gas/doc/c-z80.texi b/gas/doc/c-z80.texi
index a4366464046..dd6332d670e 100644
--- a/gas/doc/c-z80.texi
+++ b/gas/doc/c-z80.texi
@@ -24,87 +24,125 @@
@end menu
@node Z80 Options
-@section Options
+@section Command-line Options
@cindex Z80 options
@cindex options for Z80
-@table @option
+@c man begin OPTIONS
+@table @gcctabopt
@cindex @code{-z80} command-line option, Z80
@item -z80
Produce code for the Z80 processor. By default accepted undocumented
-operations with halves of index registers (IXL, IXH, IYL, IYH) and
-instuction IN F,(C). Other useful undocumented instructions produces
+operations with halves of index registers (@code{IXL}, @code{IXH}, @code{IYL}, @code{IYH}) and
+instuction @code{IN F,(C)}. Other useful undocumented instructions produces
warnings. Undocumented instructions may not work on some CPUs, use
them on your own risk.
-@cindex @code{-r800} command-line option, R800
+@cindex @code{-r800} command-line option, Z80
@item -r800
Produce code for the R800 processor.
-@cindex @code{-z180} command-line option, Z180
+@cindex @code{-z180} command-line option, Z80
@item -z180
Produce code for the Z180 processor.
-@cindex @code{-ez80} command-line option, eZ80
+@cindex @code{-ez80} command-line option, Z80
@item -ez80
Produce code for the eZ80 processor in Z80 memory mode by default.
-@cindex @code{-ez80-adl} command-line option, eZ80
+@cindex @code{-ez80-adl} command-line option, Z80
@item -ez80-adl
Produce code for the eZ80 processor in ADL memory mode by default.
-@cindex Compatibility options
-@item @code{-colonless}
+@cindex @code{-local-prefix} command-line option, Z80
+@item -local-prefix=@var{prefix}
+Mark all labels with specified prefix as local. But such label can be
+marked global explicitly in the code. This option do not change default
+local label prefix @code{.L}, it is just adds new one.
+
+@cindex @code{-colonless} command-line option, Z80
+@item -colonless
Accept colonless labels. All names at line begin are treated as labels.
-@item @code{-sdcc}
-Accept assembler code produces by SDCC.
+@cindex @code{-sdcc} command-line option, Z80
+@item -sdcc
+Accept assembler code produced by SDCC.
+
+@cindex @code{-fp-s} command-line option, Z80
+@item -fp-s=@var{FORMAT}
+Single precision floating point numbers format. Default: ieee754 (32 bit).
-@cindex Undocumented instruction control
-@item @code{-strict}
+@cindex @code{-fp-d} command-line option, Z80
+@item -fp-d=@var{FORMAT}
+Double precision floating point numbers format. Default: ieee754 (64 bit).
+
+@cindex @code{-strict} command-line option, Z80
+@item -strict
Accept documented instructions only.
-@item @code{-full}
+@cindex @code{-full} command-line option, Z80
+@item -full
Accept all known Z80 instructions.
-@item @code{-with-inst=INST[,...]}
-@itemx @code{-Wnins INST[,...]}
+@item -with-inst=@var{INST}[,...]
+@itemx -Wnins @var{INST}[,...]
Enable specified undocumented instruction(s).
-@item @code{-without-inst=INST[,...]}
-@itemx @code{-Fins INST[,...]}
+@item -without-inst=@var{INST}[,...]
+@itemx -Fins @var{INST}[,...]
Disable specified undocumented instruction(s).
-@cindex Obsolete options
-@item @code{-ignore-undocumented-instructions}
-@itemx @code{-Wnud}
+@item -ignore-undocumented-instructions
+@itemx -Wnud
Silently assemble undocumented Z80-instructions that have been adopted
as documented R800-instructions .
-@item @code{-ignore-unportable-instructions}
-@itemx @code{-Wnup}
+@item -ignore-unportable-instructions
+@itemx -Wnup
Silently assemble all undocumented Z80-instructions.
-@item @code{-warn-undocumented-instructions}
-@itemx @code{-Wud}
+@item -warn-undocumented-instructions
+@itemx -Wud
Issue warnings for undocumented Z80-instructions that work on R800, do
not assemble other undocumented instructions without warning.
-@item @code{-warn-unportable-instructions}
-@itemx @code{-Wup}
+@item -warn-unportable-instructions
+@itemx -Wup
Issue warnings for other undocumented Z80-instructions, do not treat any
undocumented instructions as errors.
-@item @code{-forbid-undocumented-instructions}
-@itemx @code{-Fud}
+@item -forbid-undocumented-instructions
+@itemx -Fud
Treat all undocumented z80-instructions as errors.
@item -forbid-unportable-instructions
-@itemx @code{-Fup}
+@itemx -Fup
Treat undocumented z80-instructions that do not work on R800 as errors.
@end table
+@c man end
+
+Floating point numbers formats.
+@table @option
+@item @code{ieee754}
+Single or double precision IEEE754 compatible format.
+
+@item @code{half}
+Half precision IEEE754 compatible format (16 bits).
+
+@item @code{single}
+Single precision IEEE754 compatible format (32 bits).
+
+@item @code{double}
+Double precision IEEE754 compatible format (64 bits).
+
+@item @code{zeda32}
+32 bit floating point format from z80float library by Zeda.
+
+@item @code{math48}
+48 bit floating point format from Math48 package by Anders Hejlsberg.
+@end table
Known undocumented instructions.
@table @option
@cindex Known undocumented instructions
@item @code{idx-reg-halves}
-All operations with halves of index registers (IXL, IXH, IYL, IYH).
+All operations with halves of index registers (@code{IXL}, @code{IXH}, @code{IYL}, @code{IYH}).
@item @code{sli}
-SLI or SLL instruction. Same as @code{SLA r; INC r}.
+@code{SLI} or @code{SLL} instruction. Same as @code{SLA r; INC r}.
@item @code{op-ii-ld}
Istructions like @code{<op> (<ii>+<d>),<r>}. For example: @code{RL (IX+5),C}
@item @code{in-f-c}
@@ -132,6 +170,7 @@ The suffix @samp{b} denotes a backreference to local label.
* Z80-Chars:: Special Characters
* Z80-Regs:: Register Names
* Z80-Case:: Case Sensitivity
+* Z80-Labels:: Labels
@end menu
@node Z80-Chars
@@ -191,11 +230,35 @@ The case of letters is significant in labels and symbol names. The case
is also important to distinguish the suffix @samp{b} for a backward reference
to a local label from the suffix @samp{B} for a number in binary notation.
+@node Z80-Labels
+@subsection Labels
+
+@cindex labels, Z80
+@cindex Z80 labels
+Labels started by @code{.L} acts as local labels. You may specify custom local
+label prefix by @code{-local-prefix} command-line option.
+Dollar, forward and backward local labels are supported. By default, all labels
+are followed by colon.
+Legacy code with colonless labels can be built with @code{-colonless}
+command-line option specified. In this case all tokens at line begin are treated
+as labels.
+
@node Z80 Floating Point
@section Floating Point
@cindex floating point, Z80
@cindex Z80 floating point
-Floating-point numbers are not supported.
+Floating-point numbers of following types are supported:
+
+@table @option
+@item @code{ieee754}
+Supported half, single and double precision IEEE754 compatible numbers.
+
+@item @code{zeda32}
+32 bit floating point numbers from z80float library by Zeda.
+
+@item @code{math48}
+48 bit floating point numbers from Math48 package by Anders Hejlsberg.
+@end table
@node Z80 Directives
@section Z80 Assembler Directives
@@ -208,15 +271,19 @@ These are the additional directives in @code{@value{AS}} for the Z80:
@table @code
@item assume @var{ADL}@samp{=}@var{expression}
-Set ADL status for eZ80. Non-null value enable compilation ADL mode else
+Set ADL status for eZ80. Non-zero value enable compilation in ADL mode else
used Z80 mode. ADL and Z80 mode produces incompatible object code. Mixing
both of them within one binary may lead problems with disassembler.
@item db @var{expression}|@var{string}[,@var{expression}|@var{string}...]
@itemx defb @var{expression}|@var{string}[,@var{expression}|@var{string}...]
+@itemx defm @var{string}...]
For each @var{string} the characters are copied to the object file, for
each other @var{expression} the value is stored in one byte.
A warning is issued in case of an overflow.
+Backslash symbol in the strings is generic symbol, it cannot be used as
+escape character (for this purpose use @code{.ascii} or @code{.asciiz}
+directives).
@item dw @var{expression}[,@var{expression}...]
@itemx defw @var{expression}[,@var{expression}...]
@@ -289,7 +356,7 @@ The assembler also supports the following undocumented Z80-instructions,
that have not been adopted in any other instruction set:
@table @code
@item out (c),0
-Sends zero to the port pointed to by register c.
+Sends zero to the port pointed to by register @code{C}.
@item sli @var{m}
Equivalent to @code{@var{m} = (@var{m}<<1)+1}, the operand @var{m} can