* remove "\r" nonsense
[mascara-docs.git] / i386 / i386.reference / s01_03.htm
blob8b2091e971083e3bbaf4e5297f776d211d072041
1 <!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML 2.0//EN">
2 <HTML>
3 <HEAD>
4 <TITLE>80386 Programmer's Reference Manual -- Section 1.3</TITLE>
5 </HEAD>
6 <BODY>
7 <B>up:</B> <A HREF="c01.htm">
8 Chapter 1 -- Introduction to the 80386</A><BR>
9 <B>prev:</B> <A HREF="s01_02.htm">1.2 Related Literature</A><BR>
10 <B>next:</B> <A HREF="c02.htm">Chapter 2 -- Basic Programming Model</A>
11 <P>
12 <HR>
13 <P>
14 <H1>1.3 Notational Conventions</H1>
15 This manual uses special notations for data-structure formats, for symbolic
16 representation of instructions, for hexadecimal numbers, and for super- and
17 sub-scripts. Subscript characters are surrounded by {curly brackets}, for
18 example 10{2} = 10 base 2. Superscript characters are preceeded by a caret
19 and enclosed within (parentheses), for example 10^(3) = 10 to the third
20 power. A review of these notations will make it easier to read the
21 manual.
23 <H2>1.3.1 Data-Structure Formats</H2>
24 In illustrations of data structures in memory, smaller addresses appear at
25 the lower-right part of the figure; addresses increase toward the left and
26 upwards. Bit positions are numbered from right to left.
27 <A HREF="#fig1-1">Figure 1-1</A>
29 illustrates this convention.
31 <H2>1.3.2 Undefined Bits and Software Compatibility</H2>
32 In many register and memory layout descriptions, certain bits are marked as
33 undefined. When bits are marked as undefined (as illustrated in
34 <A HREF="#fig1-1">Figure 1-1</A>
35 ), it is essential for compatibility with future processors that
36 software treat these bits as undefined. Software should follow these
37 guidelines in dealing with undefined bits:
38 <UL>
39 <LI> Do not depend on the states of any undefined bits when testing the
40 values of registers that contain such bits. Mask out the undefined bits
41 before testing.
42 <LI> Do not depend on the states of any undefined bits when storing them in
43 memory or in another register.
44 <LI> Do not depend on the ability to retain information written into any
45 undefined bits.
46 <LI> When loading a register, always load the undefined bits as zeros or
47 reload them with values previously stored from the same register.
48 </UL>
49 <P>
50 <HR>
51 <P>
52 <EM>
53 <H3>Note</H3>
54 Depending upon the values of undefined register bits will make software
55 dependent upon the unspecified manner in which the 80386 handles these
56 bits. Depending upon undefined values risks making software incompatible
57 with future processors that define usages for these bits. AVOID ANY
58 SOFTWARE DEPENDENCE UPON THE STATE OF UNDEFINED 80386 REGISTER BITS.
59 </EM>
60 <P>
61 <HR>
62 <P>
63 <A NAME="fig1-1">
64 <IMG align=center SRC="fig1-1.gif" border=0>
66 <H2>1.3.3 Instruction Operands</H2>
67 When instructions are represented symbolically, a subset of the 80386
68 Assembly Language is used. In this subset, an instruction has the following
69 format:
70 <PRE>
71 label: prefix mnemonic argument1, argument2, argument3
72 </PRE>
73 where:
74 <UL>
75 <LI> A <TT>label</TT> is an identifier that is followed by a colon.
76 <LI> A <TT>prefix</TT> is an optional reserved
77 name for one of the instruction prefixes.
78 <LI> A <TT>mnemonic</TT> is a reserved name for a class
79 of instruction opcodes that have the same function.
80 <LI> The operands <TT>argument1</TT>, <TT>argument2</TT>, and
81 <TT>argument3</TT> are optional. There
82 may be from zero to three operands, depending on the opcode. When
83 present, they take the form of either literals or identifiers for data
84 items. Operand identifiers are either reserved names of registers or
85 are assumed to be assigned to data items declared in another part of
86 the program (which may not be shown in the example). When two operands
87 are present in an instruction that modifies data, the right operand is
88 </UL>
89 <P>
90 the source and the left operand is the destination.
91 For example:
92 LOADREG: <A HREF="MOV.htm">MOV</A> EAX, SUBTOTAL
93 In this example LOADREG is a label, <A HREF="MOV.htm">MOV</A> is the mnemonic identifier of an
94 opcode, EAX is the destination operand, and SUBTOTAL is the source operand.
96 <H2>1.3.4 Hexadecimal Numbers</H2>
97 Base 16 numbers are represented by a string of hexadecimal digits followed
98 by the character H. A hexadecimal digit is a character from the set (0, 1,
99 2, 3, 4, 5, 6, 7, 8, 9, A, B, C, D, E, F). In some cases, especially in
100 examples of program syntax, a leading zero is added if the number would
101 otherwise begin with one of the digits A-F. For example, 0FH is equivalent
102 to the decimal number 15.
104 <H2>1.3.5 Sub- and Super-Scripts</H2>
105 This manual uses special notation to represent sub- and super-script
106 characters. Sub-script characters are surrounded by {curly brackets}, for
107 example 10{2} = 10 base 2. Super-script characters are preceeded by a
108 caret and enclosed within (parentheses), for example 10^(3) = 10 to the
109 third power.
111 <HR>
113 <B>up:</B> <A HREF="c01.htm">
114 Chapter 1 -- Introduction to the 80386</A><BR>
115 <B>prev:</B> <A HREF="s01_02.htm">1.2 Related Literature</A><BR>
116 <B>next:</B> <A HREF="c02.htm">Chapter 2 -- Basic Programming Model</A>
117 </BODY>