Files
2024-02-19 00:21:47 -05:00

253 lines
6.2 KiB
HTML

<HTML>
<HEAD>
<!-- This HTML file has been created by texi2html 1.52
from ../texi/as.texinfo on 24 April 1999 -->
<TITLE>Using as - Z8000 Dependent Features</TITLE>
</HEAD>
<BODY>
Go to the <A HREF="as_1.html">first</A>, <A HREF="as_21.html">previous</A>, <A HREF="as_23.html">next</A>, <A HREF="as_27.html">last</A> section, <A HREF="as_toc.html">table of contents</A>.
<P><HR><P>
<H1><A NAME="SEC245" HREF="as_toc.html#TOC245">Z8000 Dependent Features</A></H1>
<P>
<A NAME="IDX788"></A>
The Z8000 as supports both members of the Z8000 family: the
unsegmented Z8002, with 16 bit addresses, and the segmented Z8001 with
24 bit addresses.
</P>
<P>
When the assembler is in unsegmented mode (specified with the
<CODE>unsegm</CODE> directive), an address takes up one word (16 bit)
sized register. When the assembler is in segmented mode (specified with
the <CODE>segm</CODE> directive), a 24-bit address takes up a long (32 bit)
register. See section <A HREF="as_22.html#SEC251">Assembler Directives for the Z8000</A>,
for a list of other Z8000 specific assembler directives.
</P>
<H2><A NAME="SEC246" HREF="as_toc.html#TOC246">Options</A></H2>
<P>
<A NAME="IDX789"></A>
<A NAME="IDX790"></A>
<CODE>as</CODE> has no additional command-line options for the Zilog
Z8000 family.
</P>
<H2><A NAME="SEC247" HREF="as_toc.html#TOC247">Syntax</A></H2>
<H3><A NAME="SEC248" HREF="as_toc.html#TOC248">Special Characters</A></H3>
<P>
<A NAME="IDX791"></A>
<A NAME="IDX792"></A>
<SAMP>`!'</SAMP> is the line comment character.
</P>
<P>
<A NAME="IDX793"></A>
<A NAME="IDX794"></A>
<A NAME="IDX795"></A>
You can use <SAMP>`;'</SAMP> instead of a newline to separate statements.
</P>
<H3><A NAME="SEC249" HREF="as_toc.html#TOC249">Register Names</A></H3>
<P>
<A NAME="IDX796"></A>
<A NAME="IDX797"></A>
The Z8000 has sixteen 16 bit registers, numbered 0 to 15. You can refer
to different sized groups of registers by register number, with the
prefix <SAMP>`r'</SAMP> for 16 bit registers, <SAMP>`rr'</SAMP> for 32 bit registers and
<SAMP>`rq'</SAMP> for 64 bit registers. You can also refer to the contents of
the first eight (of the sixteen 16 bit registers) by bytes. They are
named <SAMP>`r<VAR>n</VAR>h'</SAMP> and <SAMP>`r<VAR>n</VAR>l'</SAMP>.
</P>
<PRE>
<EM>byte registers</EM>
r0l r0h r1h r1l r2h r2l r3h r3l
r4h r4l r5h r5l r6h r6l r7h r7l
<EM>word registers</EM>
r0 r1 r2 r3 r4 r5 r6 r7 r8 r9 r10 r11 r12 r13 r14 r15
<EM>long word registers</EM>
rr0 rr2 rr4 rr6 rr8 rr10 rr12 rr14
<EM>quad word registers</EM>
rq0 rq4 rq8 rq12
</PRE>
<H3><A NAME="SEC250" HREF="as_toc.html#TOC250">Addressing Modes</A></H3>
<P>
<A NAME="IDX798"></A>
<A NAME="IDX799"></A>
as understands the following addressing modes for the Z8000:
</P>
<DL COMPACT>
<DT><CODE>r<VAR>n</VAR></CODE>
<DD>
Register direct
<DT><CODE>@r<VAR>n</VAR></CODE>
<DD>
Indirect register
<DT><CODE><VAR>addr</VAR></CODE>
<DD>
Direct: the 16 bit or 24 bit address (depending on whether the assembler
is in segmented or unsegmented mode) of the operand is in the instruction.
<DT><CODE>address(r<VAR>n</VAR>)</CODE>
<DD>
Indexed: the 16 or 24 bit address is added to the 16 bit register to produce
the final address in memory of the operand.
<DT><CODE>r<VAR>n</VAR>(#<VAR>imm</VAR>)</CODE>
<DD>
Base Address: the 16 or 24 bit register is added to the 16 bit sign
extended immediate displacement to produce the final address in memory
of the operand.
<DT><CODE>r<VAR>n</VAR>(r<VAR>m</VAR>)</CODE>
<DD>
Base Index: the 16 or 24 bit register r<VAR>n</VAR> is added to the sign
extended 16 bit index register r<VAR>m</VAR> to produce the final address in
memory of the operand.
<DT><CODE>#<VAR>xx</VAR></CODE>
<DD>
Immediate data <VAR>xx</VAR>.
</DL>
<H2><A NAME="SEC251" HREF="as_toc.html#TOC251">Assembler Directives for the Z8000</A></H2>
<P>
<A NAME="IDX800"></A>
<A NAME="IDX801"></A>
The Z8000 port of as includes these additional assembler directives,
for compatibility with other Z8000 assemblers. As shown, these do not
begin with <SAMP>`.'</SAMP> (unlike the ordinary as directives).
</P>
<DL COMPACT>
<DT><CODE>segm</CODE>
<DD>
<A NAME="IDX802"></A>
Generates code for the segmented Z8001.
<A NAME="IDX803"></A>
<DT><CODE>unsegm</CODE>
<DD>
Generates code for the unsegmented Z8002.
<A NAME="IDX804"></A>
<DT><CODE>name</CODE>
<DD>
Synonym for <CODE>.file</CODE>
<A NAME="IDX805"></A>
<DT><CODE>global</CODE>
<DD>
Synonym for <CODE>.global</CODE>
<A NAME="IDX806"></A>
<DT><CODE>wval</CODE>
<DD>
Synonym for <CODE>.word</CODE>
<A NAME="IDX807"></A>
<DT><CODE>lval</CODE>
<DD>
Synonym for <CODE>.long</CODE>
<A NAME="IDX808"></A>
<DT><CODE>bval</CODE>
<DD>
Synonym for <CODE>.byte</CODE>
<A NAME="IDX809"></A>
<DT><CODE>sval</CODE>
<DD>
Assemble a string. <CODE>sval</CODE> expects one string literal, delimited by
single quotes. It assembles each byte of the string into consecutive
addresses. You can use the escape sequence <SAMP>`%<VAR>xx</VAR>'</SAMP> (where
<VAR>xx</VAR> represents a two-digit hexadecimal number) to represent the
character whose ASCII value is <VAR>xx</VAR>. Use this feature to
describe single quote and other characters that may not appear in string
literals as themselves. For example, the C statement <SAMP>`char *a =
"he said \"it's 50% off\"";'</SAMP> is represented in Z8000 assembly language
(shown with the assembler output in hex at the left) as
@begingroup
@let@nonarrowing=@comment
<PRE>
68652073 sval 'he said %22it%27s 50%25 off%22%00'
61696420
22697427
73203530
25206F66
662200
</PRE>
@endgroup
<A NAME="IDX810"></A>
<DT><CODE>rsect</CODE>
<DD>
synonym for <CODE>.section</CODE>
<A NAME="IDX811"></A>
<DT><CODE>block</CODE>
<DD>
synonym for <CODE>.space</CODE>
<A NAME="IDX812"></A>
<DT><CODE>even</CODE>
<DD>
special case of <CODE>.align</CODE>; aligns output to even byte boundary.
</DL>
<H2><A NAME="SEC252" HREF="as_toc.html#TOC252">Opcodes</A></H2>
<P>
<A NAME="IDX813"></A>
<A NAME="IDX814"></A>
<A NAME="IDX815"></A>
<A NAME="IDX816"></A>
For detailed information on the Z8000 machine instruction set, see
<CITE>Z8000 Technical Manual</CITE>.
</P>
<P><HR><P>
Go to the <A HREF="as_1.html">first</A>, <A HREF="as_21.html">previous</A>, <A HREF="as_23.html">next</A>, <A HREF="as_27.html">last</A> section, <A HREF="as_toc.html">table of contents</A>.
</BODY>
</HTML>