Intel XENIX 286 Programmers Guide (86) - Tenox.tc
Intel XENIX 286 Programmers Guide (86) - Tenox.tc Intel XENIX 286 Programmers Guide (86) - Tenox.tc
XENIX Programming as: Assembler A numeric label consists of a string of the digits 0 to 9 followed by a dollar sign ($) followed by a colon (:). Such a label serves to define local symbols of the form n$ where n is the digit of the label. The scope of the nu meric label is the labeled block in which it appears. As an example, the label "9$" is defined only between the labels Iabell and label2: label 1: 9$: label2: .byte 0 .word a As in the case of name labels, a numeric label assigns the current value and type of dot to the symbol. Null Statements A null statement is an empty statement (which may, however, have labels and a comment). A null statement is ignored by the assembler. Common examples of null statements are empty lines or comment lines. Expression Statements An expression statement consists of an arithmetic expression not beginning with a keyword. The assembler computes its value and places it in the output stream, together with the appropriate relocation bits. Assignment Statements An assignment statement consists of an identifier, an equal sign (=), and an expression. The value and type of the expression are assigned to the identifier. It is not required that the type or value be the same in pass 2 as in pass 1, nor is it an error to redefine any sy mbol by assignment. Any external attribute of an expression is lost across an assignment. Thus you cannot declare a global sy mbol by assigning to it. Nor can you define a symbol to be offset from a nonlocally-defined global symbol. As mentioned, you can assign the location counter. It is required, however, that the type of the expression assigned be of the same type as dot, and an assign ment cannot decrease the value of dot. In practice, the most common assignment to dot has the form . = . +n for some number n; this has the effect of generating n null bytes. 7-5
as: Assembler XENIX Programming Keyword Statements Keyword statements are numerically the most com mon type, since most machine instructions are of this sort. A keyword statement begins with one of the many predefined keywords of the assembler. The syntax of the remainder depends on the keyword. All the keywords are listed in the section "Mnemonic List" later in this chapter. Expressions An expression is a sequence of symbols representing a value. An expression contains identifiers, constants, and operators. Each expression has a type. Arithmetic is two's complement. All operators have equal precedence, and expressions are evaluated strictly left to right. Expression Operators The operators are Operator + * I Types & >>
- Page 83 and 84: SCCS: Source Code Control System XE
- Page 85 and 86: SCCS: Source Code Control System XE
- Page 87 and 88: SCCS: Source Code Control System XE
- Page 89 and 90: SCCS: Source Code Control System XE
- Page 91 and 92: SCCS: Source Code Control System XE
- Page 93 and 94: SCCS: Source Code Control System XE
- Page 95 and 96: SCCS: Source Code Control System XE
- Page 98 and 99: CHAPTER 6 adb: PROGRAM DEBUGGER adb
- Page 100 and 101: XENIX Programming adb: Program Debu
- Page 102 and 103: XENIX Programming adb: Program Debu
- Page 104 and 105: XENIX Programming adb: Program Debu
- Page 106 and 107: XENIX Programming adb: Program Debu
- Page 108 and 109: XENIX Programming adb: Program Debu
- Page 110 and 111: XENIX Programming adb: Program Debu
- Page 112 and 113: XENIX Programming adb: Program Debu
- Page 114 and 115: XENIX Programming adb: Program Debu
- Page 116 and 117: XENIX Programming int fcnt,gcnt,hcn
- Page 118 and 119: XENIX Programming adb: Program Debu
- Page 120 and 121: XENIX Programming adb: Program Debu
- Page 122 and 123: XENIX Programming adb: Program Debu
- Page 124 and 125: XENIX Programming adb: Program Debu
- Page 126 and 127: XENIX Programming adb: Program Debu
- Page 128: XENIX Programming adb: Program Debu
- Page 131 and 132: as: A sse m bier XENIX Programming
- Page 133: as: Assembler XENIX Programming The
- Page 137 and 138: as: Assembler The combination rules
- Page 139 and 140: as: Assembler XENIX Programming Ins
- Page 141 and 142: as: Assembler Initial Value Directi
- Page 143 and 144: as: Assembler XENIX Programming int
- Page 145 and 146: as: A sse m bier sub subb test test
- Page 147 and 148: as: Assembler XENIX Programming lnt
- Page 149 and 150: as: Assembler XENIX Programming lnt
- Page 151 and 152: as: Assembler XENIX Programming Imm
- Page 153 and 154: as: A sse m bier XENIX Programming
- Page 156 and 157: CHAPTER 8 csh : C SHEll The C shell
- Page 158 and 159: XENIX Programming csh: C Shell Some
- Page 160 and 161: XENIX Programm ing *w 32 * q % !c -
- Page 162 and 163: XENIX Programming csh: C Shell the
- Page 164 and 165: XENIX Programming csh: C Shell Usin
- Page 166 and 167: XENIX Programming csh: C Shell Usin
- Page 168 and 169: XENIX Programming csh: C Shell The
- Page 170 and 171: XENIX Programming csh: C Shell Note
- Page 172 and 173: XENIX Programming switch ( string c
- Page 174 and 175: XENIX Programming csh: C Shell Star
- Page 176 and 177: XENIX Programming csh: C Shell Spec
- Page 178 and 179: CHAPTER 9 lex : LEXICAL ANA LYZER G
- Page 180 and 181: XENIX Programming lex: Lexical Anal
- Page 182 and 183: XENIX Programming lex: Lexical Anal
<strong>XENIX</strong> Programming as: Assembler<br />
A numeric label consists of a string of the digits 0 to 9 followed by a dollar sign ($)<br />
followed by a colon (:). Such a label serves to define local symbols of the form<br />
n$<br />
where n is the digit of the label. The scope of the nu meric label is the labeled block in<br />
which it appears. As an example, the label "9$" is defined only between the labels<br />
Iabell and label2:<br />
label 1:<br />
9$:<br />
label2:<br />
.byte 0<br />
.word a<br />
As in the case of name labels, a numeric label assigns the current value and type of dot<br />
to the symbol.<br />
Null Statements<br />
A null statement is an empty statement (which may, however, have labels and a<br />
comment). A null statement is ignored by the assembler. Common examples of null<br />
statements are empty lines or comment lines.<br />
Expression Statements<br />
An expression statement consists of an arithmetic expression not beginning with a<br />
keyword. The assembler computes its value and places it in the output stream, together<br />
with the appropriate relocation bits.<br />
Assignment Statements<br />
An assignment statement consists of an identifier, an equal sign (=), and an expression.<br />
The value and type of the expression are assigned to the identifier. It is not required<br />
that the type or value be the same in pass 2 as in pass 1, nor is it an error to redefine<br />
any sy mbol by assignment.<br />
Any external attribute of an expression is lost across an assignment. Thus you cannot<br />
declare a global sy mbol by assigning to it. Nor can you define a symbol to be offset<br />
from a nonlocally-defined global symbol.<br />
As mentioned, you can assign the location counter. It is required, however, that the<br />
type of the expression assigned be of the same type as dot, and an assign ment cannot<br />
decrease the value of dot. In practice, the most common assignment to dot has the<br />
form<br />
. = . +n<br />
for some number n; this has the effect of generating n null bytes.<br />
7-5