| 1 | This is as.info, produced by makeinfo version 4.3 from as.texinfo.
|
|---|
| 2 |
|
|---|
| 3 | START-INFO-DIR-ENTRY
|
|---|
| 4 | * As: (as). The GNU assembler.
|
|---|
| 5 | * Gas: (as). The GNU assembler.
|
|---|
| 6 | END-INFO-DIR-ENTRY
|
|---|
| 7 |
|
|---|
| 8 | This file documents the GNU Assembler "as".
|
|---|
| 9 |
|
|---|
| 10 | Copyright (C) 1991, 92, 93, 94, 95, 96, 97, 98, 99, 2000, 2001, 2002
|
|---|
| 11 | Free Software Foundation, Inc.
|
|---|
| 12 |
|
|---|
| 13 | Permission is granted to copy, distribute and/or modify this document
|
|---|
| 14 | under the terms of the GNU Free Documentation License, Version 1.1 or
|
|---|
| 15 | any later version published by the Free Software Foundation; with no
|
|---|
| 16 | Invariant Sections, with no Front-Cover Texts, and with no Back-Cover
|
|---|
| 17 | Texts. A copy of the license is included in the section entitled "GNU
|
|---|
| 18 | Free Documentation License".
|
|---|
| 19 |
|
|---|
| 20 |
|
|---|
| 21 | File: as.info, Node: SH64 Opcodes, Prev: SH64 Directives, Up: SH64-Dependent
|
|---|
| 22 |
|
|---|
| 23 | Opcodes
|
|---|
| 24 | -------
|
|---|
| 25 |
|
|---|
| 26 | For detailed information on the SH64 machine instruction set, see
|
|---|
| 27 | `SuperH 64 bit RISC Series Architecture Manual' (SuperH, Inc.).
|
|---|
| 28 |
|
|---|
| 29 | `as' implements all the standard SH64 opcodes. In addition, the
|
|---|
| 30 | following pseudo-opcodes may be expanded into one or more alternate
|
|---|
| 31 | opcodes:
|
|---|
| 32 |
|
|---|
| 33 | `movi'
|
|---|
| 34 | If the value doesn't fit into a standard `movi' opcode, `as' will
|
|---|
| 35 | replace the `movi' with a sequence of `movi' and `shori' opcodes.
|
|---|
| 36 |
|
|---|
| 37 | `pt'
|
|---|
| 38 | This expands to a sequence of `movi' and `shori' opcode, followed
|
|---|
| 39 | by a `ptrel' opcode, or to a `pta' or `ptb' opcode, depending on
|
|---|
| 40 | the label referenced.
|
|---|
| 41 |
|
|---|
| 42 |
|
|---|
| 43 | File: as.info, Node: Sparc-Dependent, Next: TIC54X-Dependent, Prev: PPC-Dependent, Up: Machine Dependencies
|
|---|
| 44 |
|
|---|
| 45 | SPARC Dependent Features
|
|---|
| 46 | ========================
|
|---|
| 47 |
|
|---|
| 48 | * Menu:
|
|---|
| 49 |
|
|---|
| 50 | * Sparc-Opts:: Options
|
|---|
| 51 | * Sparc-Aligned-Data:: Option to enforce aligned data
|
|---|
| 52 | * Sparc-Float:: Floating Point
|
|---|
| 53 | * Sparc-Directives:: Sparc Machine Directives
|
|---|
| 54 |
|
|---|
| 55 |
|
|---|
| 56 | File: as.info, Node: Sparc-Opts, Next: Sparc-Aligned-Data, Up: Sparc-Dependent
|
|---|
| 57 |
|
|---|
| 58 | Options
|
|---|
| 59 | -------
|
|---|
| 60 |
|
|---|
| 61 | The SPARC chip family includes several successive levels, using the
|
|---|
| 62 | same core instruction set, but including a few additional instructions
|
|---|
| 63 | at each level. There are exceptions to this however. For details on
|
|---|
| 64 | what instructions each variant supports, please see the chip's
|
|---|
| 65 | architecture reference manual.
|
|---|
| 66 |
|
|---|
| 67 | By default, `as' assumes the core instruction set (SPARC v6), but
|
|---|
| 68 | "bumps" the architecture level as needed: it switches to successively
|
|---|
| 69 | higher architectures as it encounters instructions that only exist in
|
|---|
| 70 | the higher levels.
|
|---|
| 71 |
|
|---|
| 72 | If not configured for SPARC v9 (`sparc64-*-*') GAS will not bump
|
|---|
| 73 | passed sparclite by default, an option must be passed to enable the v9
|
|---|
| 74 | instructions.
|
|---|
| 75 |
|
|---|
| 76 | GAS treats sparclite as being compatible with v8, unless an
|
|---|
| 77 | architecture is explicitly requested. SPARC v9 is always incompatible
|
|---|
| 78 | with sparclite.
|
|---|
| 79 |
|
|---|
| 80 | `-Av6 | -Av7 | -Av8 | -Asparclet | -Asparclite'
|
|---|
| 81 | `-Av8plus | -Av8plusa | -Av9 | -Av9a'
|
|---|
| 82 | Use one of the `-A' options to select one of the SPARC
|
|---|
| 83 | architectures explicitly. If you select an architecture
|
|---|
| 84 | explicitly, `as' reports a fatal error if it encounters an
|
|---|
| 85 | instruction or feature requiring an incompatible or higher level.
|
|---|
| 86 |
|
|---|
| 87 | `-Av8plus' and `-Av8plusa' select a 32 bit environment.
|
|---|
| 88 |
|
|---|
| 89 | `-Av9' and `-Av9a' select a 64 bit environment and are not
|
|---|
| 90 | available unless GAS is explicitly configured with 64 bit
|
|---|
| 91 | environment support.
|
|---|
| 92 |
|
|---|
| 93 | `-Av8plusa' and `-Av9a' enable the SPARC V9 instruction set with
|
|---|
| 94 | UltraSPARC extensions.
|
|---|
| 95 |
|
|---|
| 96 | `-xarch=v8plus | -xarch=v8plusa'
|
|---|
| 97 | For compatibility with the Solaris v9 assembler. These options are
|
|---|
| 98 | equivalent to -Av8plus and -Av8plusa, respectively.
|
|---|
| 99 |
|
|---|
| 100 | `-bump'
|
|---|
| 101 | Warn whenever it is necessary to switch to another level. If an
|
|---|
| 102 | architecture level is explicitly requested, GAS will not issue
|
|---|
| 103 | warnings until that level is reached, and will then bump the level
|
|---|
| 104 | as required (except between incompatible levels).
|
|---|
| 105 |
|
|---|
| 106 | `-32 | -64'
|
|---|
| 107 | Select the word size, either 32 bits or 64 bits. These options
|
|---|
| 108 | are only available with the ELF object file format, and require
|
|---|
| 109 | that the necessary BFD support has been included.
|
|---|
| 110 |
|
|---|
| 111 |
|
|---|
| 112 | File: as.info, Node: Sparc-Aligned-Data, Next: Sparc-Float, Prev: Sparc-Opts, Up: Sparc-Dependent
|
|---|
| 113 |
|
|---|
| 114 | Enforcing aligned data
|
|---|
| 115 | ----------------------
|
|---|
| 116 |
|
|---|
| 117 | SPARC GAS normally permits data to be misaligned. For example, it
|
|---|
| 118 | permits the `.long' pseudo-op to be used on a byte boundary. However,
|
|---|
| 119 | the native SunOS and Solaris assemblers issue an error when they see
|
|---|
| 120 | misaligned data.
|
|---|
| 121 |
|
|---|
| 122 | You can use the `--enforce-aligned-data' option to make SPARC GAS
|
|---|
| 123 | also issue an error about misaligned data, just as the SunOS and Solaris
|
|---|
| 124 | assemblers do.
|
|---|
| 125 |
|
|---|
| 126 | The `--enforce-aligned-data' option is not the default because gcc
|
|---|
| 127 | issues misaligned data pseudo-ops when it initializes certain packed
|
|---|
| 128 | data structures (structures defined using the `packed' attribute). You
|
|---|
| 129 | may have to assemble with GAS in order to initialize packed data
|
|---|
| 130 | structures in your own code.
|
|---|
| 131 |
|
|---|
| 132 |
|
|---|
| 133 | File: as.info, Node: Sparc-Float, Next: Sparc-Directives, Prev: Sparc-Aligned-Data, Up: Sparc-Dependent
|
|---|
| 134 |
|
|---|
| 135 | Floating Point
|
|---|
| 136 | --------------
|
|---|
| 137 |
|
|---|
| 138 | The Sparc uses IEEE floating-point numbers.
|
|---|
| 139 |
|
|---|
| 140 |
|
|---|
| 141 | File: as.info, Node: Sparc-Directives, Prev: Sparc-Float, Up: Sparc-Dependent
|
|---|
| 142 |
|
|---|
| 143 | Sparc Machine Directives
|
|---|
| 144 | ------------------------
|
|---|
| 145 |
|
|---|
| 146 | The Sparc version of `as' supports the following additional machine
|
|---|
| 147 | directives:
|
|---|
| 148 |
|
|---|
| 149 | `.align'
|
|---|
| 150 | This must be followed by the desired alignment in bytes.
|
|---|
| 151 |
|
|---|
| 152 | `.common'
|
|---|
| 153 | This must be followed by a symbol name, a positive number, and
|
|---|
| 154 | `"bss"'. This behaves somewhat like `.comm', but the syntax is
|
|---|
| 155 | different.
|
|---|
| 156 |
|
|---|
| 157 | `.half'
|
|---|
| 158 | This is functionally identical to `.short'.
|
|---|
| 159 |
|
|---|
| 160 | `.nword'
|
|---|
| 161 | On the Sparc, the `.nword' directive produces native word sized
|
|---|
| 162 | value, ie. if assembling with -32 it is equivalent to `.word', if
|
|---|
| 163 | assembling with -64 it is equivalent to `.xword'.
|
|---|
| 164 |
|
|---|
| 165 | `.proc'
|
|---|
| 166 | This directive is ignored. Any text following it on the same line
|
|---|
| 167 | is also ignored.
|
|---|
| 168 |
|
|---|
| 169 | `.register'
|
|---|
| 170 | This directive declares use of a global application or system
|
|---|
| 171 | register. It must be followed by a register name %g2, %g3, %g6 or
|
|---|
| 172 | %g7, comma and the symbol name for that register. If symbol name
|
|---|
| 173 | is `#scratch', it is a scratch register, if it is `#ignore', it
|
|---|
| 174 | just suppresses any errors about using undeclared global register,
|
|---|
| 175 | but does not emit any information about it into the object file.
|
|---|
| 176 | This can be useful e.g. if you save the register before use and
|
|---|
| 177 | restore it after.
|
|---|
| 178 |
|
|---|
| 179 | `.reserve'
|
|---|
| 180 | This must be followed by a symbol name, a positive number, and
|
|---|
| 181 | `"bss"'. This behaves somewhat like `.lcomm', but the syntax is
|
|---|
| 182 | different.
|
|---|
| 183 |
|
|---|
| 184 | `.seg'
|
|---|
| 185 | This must be followed by `"text"', `"data"', or `"data1"'. It
|
|---|
| 186 | behaves like `.text', `.data', or `.data 1'.
|
|---|
| 187 |
|
|---|
| 188 | `.skip'
|
|---|
| 189 | This is functionally identical to the `.space' directive.
|
|---|
| 190 |
|
|---|
| 191 | `.word'
|
|---|
| 192 | On the Sparc, the `.word' directive produces 32 bit values,
|
|---|
| 193 | instead of the 16 bit values it produces on many other machines.
|
|---|
| 194 |
|
|---|
| 195 | `.xword'
|
|---|
| 196 | On the Sparc V9 processor, the `.xword' directive produces 64 bit
|
|---|
| 197 | values.
|
|---|
| 198 |
|
|---|
| 199 |
|
|---|
| 200 | File: as.info, Node: TIC54X-Dependent, Next: V850-Dependent, Prev: Sparc-Dependent, Up: Machine Dependencies
|
|---|
| 201 |
|
|---|
| 202 | TIC54X Dependent Features
|
|---|
| 203 | =========================
|
|---|
| 204 |
|
|---|
| 205 | * Menu:
|
|---|
| 206 |
|
|---|
| 207 | * TIC54X-Opts:: Command-line Options
|
|---|
| 208 | * TIC54X-Block:: Blocking
|
|---|
| 209 | * TIC54X-Env:: Environment Settings
|
|---|
| 210 | * TIC54X-Constants:: Constants Syntax
|
|---|
| 211 | * TIC54X-Subsyms:: String Substitution
|
|---|
| 212 | * TIC54X-Locals:: Local Label Syntax
|
|---|
| 213 | * TIC54X-Builtins:: Builtin Assembler Math Functions
|
|---|
| 214 | * TIC54X-Ext:: Extended Addressing Support
|
|---|
| 215 | * TIC54X-Directives:: Directives
|
|---|
| 216 | * TIC54X-Macros:: Macro Features
|
|---|
| 217 | * TIC54X-MMRegs:: Memory-mapped Registers
|
|---|
| 218 |
|
|---|
| 219 |
|
|---|
| 220 | File: as.info, Node: TIC54X-Opts, Next: TIC54X-Block, Up: TIC54X-Dependent
|
|---|
| 221 |
|
|---|
| 222 | Options
|
|---|
| 223 | -------
|
|---|
| 224 |
|
|---|
| 225 | The TMS320C54x version of `as' has a few machine-dependent options.
|
|---|
| 226 |
|
|---|
| 227 | You can use the `-mfar-mode' option to enable extended addressing
|
|---|
| 228 | mode. All addresses will be assumed to be > 16 bits, and the
|
|---|
| 229 | appropriate relocation types will be used. This option is equivalent
|
|---|
| 230 | to using the `.far_mode' directive in the assembly code. If you do not
|
|---|
| 231 | use the `-mfar-mode' option, all references will be assumed to be 16
|
|---|
| 232 | bits. This option may be abbreviated to `-mf'.
|
|---|
| 233 |
|
|---|
| 234 | You can use the `-mcpu' option to specify a particular CPU. This
|
|---|
| 235 | option is equivalent to using the `.version' directive in the assembly
|
|---|
| 236 | code. For recognized CPU codes, see *Note `.version':
|
|---|
| 237 | TIC54X-Directives. The default CPU version is `542'.
|
|---|
| 238 |
|
|---|
| 239 | You can use the `-merrors-to-file' option to redirect error output
|
|---|
| 240 | to a file (this provided for those deficient environments which don't
|
|---|
| 241 | provide adequate output redirection). This option may be abbreviated to
|
|---|
| 242 | `-me'.
|
|---|
| 243 |
|
|---|
| 244 |
|
|---|
| 245 | File: as.info, Node: TIC54X-Block, Next: TIC54X-Env, Prev: TIC54X-Opts, Up: TIC54X-Dependent
|
|---|
| 246 |
|
|---|
| 247 | Blocking
|
|---|
| 248 | --------
|
|---|
| 249 |
|
|---|
| 250 | A blocked section or memory block is guaranteed not to cross the
|
|---|
| 251 | blocking boundary (usually a page, or 128 words) if it is smaller than
|
|---|
| 252 | the blocking size, or to start on a page boundary if it is larger than
|
|---|
| 253 | the blocking size.
|
|---|
| 254 |
|
|---|
| 255 |
|
|---|
| 256 | File: as.info, Node: TIC54X-Env, Next: TIC54X-Constants, Prev: TIC54X-Block, Up: TIC54X-Dependent
|
|---|
| 257 |
|
|---|
| 258 | Environment Settings
|
|---|
| 259 | --------------------
|
|---|
| 260 |
|
|---|
| 261 | `C54XDSP_DIR' and `A_DIR' are semicolon-separated paths which are
|
|---|
| 262 | added to the list of directories normally searched for source and
|
|---|
| 263 | include files. `C54XDSP_DIR' will override `A_DIR'.
|
|---|
| 264 |
|
|---|
| 265 |
|
|---|
| 266 | File: as.info, Node: TIC54X-Constants, Next: TIC54X-Subsyms, Prev: TIC54X-Env, Up: TIC54X-Dependent
|
|---|
| 267 |
|
|---|
| 268 | Constants Syntax
|
|---|
| 269 | ----------------
|
|---|
| 270 |
|
|---|
| 271 | The TIC54X version of `as' allows the following additional constant
|
|---|
| 272 | formats, using a suffix to indicate the radix:
|
|---|
| 273 |
|
|---|
| 274 | Binary `000000B, 011000b'
|
|---|
| 275 | Octal `10Q, 224q'
|
|---|
| 276 | Hexadecimal `45h, 0FH'
|
|---|
| 277 |
|
|---|
| 278 |
|
|---|
| 279 | File: as.info, Node: TIC54X-Subsyms, Next: TIC54X-Locals, Prev: TIC54X-Constants, Up: TIC54X-Dependent
|
|---|
| 280 |
|
|---|
| 281 | String Substitution
|
|---|
| 282 | -------------------
|
|---|
| 283 |
|
|---|
| 284 | A subset of allowable symbols (which we'll call subsyms) may be
|
|---|
| 285 | assigned arbitrary string values. This is roughly equivalent to C
|
|---|
| 286 | preprocessor #define macros. When `as' encounters one of these
|
|---|
| 287 | symbols, the symbol is replaced in the input stream by its string value.
|
|---|
| 288 | Subsym names *must* begin with a letter.
|
|---|
| 289 |
|
|---|
| 290 | Subsyms may be defined using the `.asg' and `.eval' directives
|
|---|
| 291 | (*Note `.asg': TIC54X-Directives, *Note `.eval': TIC54X-Directives.
|
|---|
| 292 |
|
|---|
| 293 | Expansion is recursive until a previously encountered symbol is
|
|---|
| 294 | seen, at which point substitution stops.
|
|---|
| 295 |
|
|---|
| 296 | In this example, x is replaced with SYM2; SYM2 is replaced with
|
|---|
| 297 | SYM1, and SYM1 is replaced with x. At this point, x has already been
|
|---|
| 298 | encountered and the substitution stops.
|
|---|
| 299 |
|
|---|
| 300 | .asg "x",SYM1
|
|---|
| 301 | .asg "SYM1",SYM2
|
|---|
| 302 | .asg "SYM2",x
|
|---|
| 303 | add x,a ; final code assembled is "add x, a"
|
|---|
| 304 |
|
|---|
| 305 | Macro parameters are converted to subsyms; a side effect of this is
|
|---|
| 306 | the normal `as' '\ARG' dereferencing syntax is unnecessary. Subsyms
|
|---|
| 307 | defined within a macro will have global scope, unless the `.var'
|
|---|
| 308 | directive is used to identify the subsym as a local macro variable
|
|---|
| 309 | *note `.var': TIC54X-Directives..
|
|---|
| 310 |
|
|---|
| 311 | Substitution may be forced in situations where replacement might be
|
|---|
| 312 | ambiguous by placing colons on either side of the subsym. The following
|
|---|
| 313 | code:
|
|---|
| 314 |
|
|---|
| 315 | .eval "10",x
|
|---|
| 316 | LAB:X: add #x, a
|
|---|
| 317 |
|
|---|
| 318 | When assembled becomes:
|
|---|
| 319 |
|
|---|
| 320 | LAB10 add #10, a
|
|---|
| 321 |
|
|---|
| 322 | Smaller parts of the string assigned to a subsym may be accessed with
|
|---|
| 323 | the following syntax:
|
|---|
| 324 |
|
|---|
| 325 | ``:SYMBOL(CHAR_INDEX):''
|
|---|
| 326 | Evaluates to a single-character string, the character at
|
|---|
| 327 | CHAR_INDEX.
|
|---|
| 328 |
|
|---|
| 329 | ``:SYMBOL(START,LENGTH):''
|
|---|
| 330 | Evaluates to a substring of SYMBOL beginning at START with length
|
|---|
| 331 | LENGTH.
|
|---|
| 332 |
|
|---|
| 333 |
|
|---|
| 334 | File: as.info, Node: TIC54X-Locals, Next: TIC54X-Builtins, Prev: TIC54X-Subsyms, Up: TIC54X-Dependent
|
|---|
| 335 |
|
|---|
| 336 | Local Labels
|
|---|
| 337 | ------------
|
|---|
| 338 |
|
|---|
| 339 | Local labels may be defined in two ways:
|
|---|
| 340 |
|
|---|
| 341 | * $N, where N is a decimal number between 0 and 9
|
|---|
| 342 |
|
|---|
| 343 | * LABEL?, where LABEL is any legal symbol name.
|
|---|
| 344 |
|
|---|
| 345 | Local labels thus defined may be redefined or automatically
|
|---|
| 346 | generated. The scope of a local label is based on when it may be
|
|---|
| 347 | undefined or reset. This happens when one of the following situations
|
|---|
| 348 | is encountered:
|
|---|
| 349 |
|
|---|
| 350 | * .newblock directive *note `.newblock': TIC54X-Directives.
|
|---|
| 351 |
|
|---|
| 352 | * The current section is changed (.sect, .text, or .data)
|
|---|
| 353 |
|
|---|
| 354 | * Entering or leaving an included file
|
|---|
| 355 |
|
|---|
| 356 | * The macro scope where the label was defined is exited
|
|---|
| 357 |
|
|---|
| 358 |
|
|---|
| 359 | File: as.info, Node: TIC54X-Builtins, Next: TIC54X-Ext, Prev: TIC54X-Locals, Up: TIC54X-Dependent
|
|---|
| 360 |
|
|---|
| 361 | Math Builtins
|
|---|
| 362 | -------------
|
|---|
| 363 |
|
|---|
| 364 | The following built-in functions may be used to generate a
|
|---|
| 365 | floating-point value. All return a floating-point value except `$cvi',
|
|---|
| 366 | `$int', and `$sgn', which return an integer value.
|
|---|
| 367 |
|
|---|
| 368 | ``$acos(EXPR)''
|
|---|
| 369 | Returns the floating point arccosine of EXPR.
|
|---|
| 370 |
|
|---|
| 371 | ``$asin(EXPR)''
|
|---|
| 372 | Returns the floating point arcsine of EXPR.
|
|---|
| 373 |
|
|---|
| 374 | ``$atan(EXPR)''
|
|---|
| 375 | Returns the floating point arctangent of EXPR.
|
|---|
| 376 |
|
|---|
| 377 | ``$atan2(EXPR1,EXPR2)''
|
|---|
| 378 | Returns the floating point arctangent of EXPR1 / EXPR2.
|
|---|
| 379 |
|
|---|
| 380 | ``$ceil(EXPR)''
|
|---|
| 381 | Returns the smallest integer not less than EXPR as floating point.
|
|---|
| 382 |
|
|---|
| 383 | ``$cosh(EXPR)''
|
|---|
| 384 | Returns the floating point hyperbolic cosine of EXPR.
|
|---|
| 385 |
|
|---|
| 386 | ``$cos(EXPR)''
|
|---|
| 387 | Returns the floating point cosine of EXPR.
|
|---|
| 388 |
|
|---|
| 389 | ``$cvf(EXPR)''
|
|---|
| 390 | Returns the integer value EXPR converted to floating-point.
|
|---|
| 391 |
|
|---|
| 392 | ``$cvi(EXPR)''
|
|---|
| 393 | Returns the floating point value EXPR converted to integer.
|
|---|
| 394 |
|
|---|
| 395 | ``$exp(EXPR)''
|
|---|
| 396 | Returns the floating point value e ^ EXPR.
|
|---|
| 397 |
|
|---|
| 398 | ``$fabs(EXPR)''
|
|---|
| 399 | Returns the floating point absolute value of EXPR.
|
|---|
| 400 |
|
|---|
| 401 | ``$floor(EXPR)''
|
|---|
| 402 | Returns the largest integer that is not greater than EXPR as
|
|---|
| 403 | floating point.
|
|---|
| 404 |
|
|---|
| 405 | ``$fmod(EXPR1,EXPR2)''
|
|---|
| 406 | Returns the floating point remainder of EXPR1 / EXPR2.
|
|---|
| 407 |
|
|---|
| 408 | ``$int(EXPR)''
|
|---|
| 409 | Returns 1 if EXPR evaluates to an integer, zero otherwise.
|
|---|
| 410 |
|
|---|
| 411 | ``$ldexp(EXPR1,EXPR2)''
|
|---|
| 412 | Returns the floating point value EXPR1 * 2 ^ EXPR2.
|
|---|
| 413 |
|
|---|
| 414 | ``$log10(EXPR)''
|
|---|
| 415 | Returns the base 10 logarithm of EXPR.
|
|---|
| 416 |
|
|---|
| 417 | ``$log(EXPR)''
|
|---|
| 418 | Returns the natural logarithm of EXPR.
|
|---|
| 419 |
|
|---|
| 420 | ``$max(EXPR1,EXPR2)''
|
|---|
| 421 | Returns the floating point maximum of EXPR1 and EXPR2.
|
|---|
| 422 |
|
|---|
| 423 | ``$min(EXPR1,EXPR2)''
|
|---|
| 424 | Returns the floating point minimum of EXPR1 and EXPR2.
|
|---|
| 425 |
|
|---|
| 426 | ``$pow(EXPR1,EXPR2)''
|
|---|
| 427 | Returns the floating point value EXPR1 ^ EXPR2.
|
|---|
| 428 |
|
|---|
| 429 | ``$round(EXPR)''
|
|---|
| 430 | Returns the nearest integer to EXPR as a floating point number.
|
|---|
| 431 |
|
|---|
| 432 | ``$sgn(EXPR)''
|
|---|
| 433 | Returns -1, 0, or 1 based on the sign of EXPR.
|
|---|
| 434 |
|
|---|
| 435 | ``$sin(EXPR)''
|
|---|
| 436 | Returns the floating point sine of EXPR.
|
|---|
| 437 |
|
|---|
| 438 | ``$sinh(EXPR)''
|
|---|
| 439 | Returns the floating point hyperbolic sine of EXPR.
|
|---|
| 440 |
|
|---|
| 441 | ``$sqrt(EXPR)''
|
|---|
| 442 | Returns the floating point square root of EXPR.
|
|---|
| 443 |
|
|---|
| 444 | ``$tan(EXPR)''
|
|---|
| 445 | Returns the floating point tangent of EXPR.
|
|---|
| 446 |
|
|---|
| 447 | ``$tanh(EXPR)''
|
|---|
| 448 | Returns the floating point hyperbolic tangent of EXPR.
|
|---|
| 449 |
|
|---|
| 450 | ``$trunc(EXPR)''
|
|---|
| 451 | Returns the integer value of EXPR truncated towards zero as
|
|---|
| 452 | floating point.
|
|---|
| 453 |
|
|---|
| 454 |
|
|---|
| 455 | File: as.info, Node: TIC54X-Ext, Next: TIC54X-Directives, Prev: TIC54X-Builtins, Up: TIC54X-Dependent
|
|---|
| 456 |
|
|---|
| 457 | Extended Addressing
|
|---|
| 458 | -------------------
|
|---|
| 459 |
|
|---|
| 460 | The `LDX' pseudo-op is provided for loading the extended addressing
|
|---|
| 461 | bits of a label or address. For example, if an address `_label' resides
|
|---|
| 462 | in extended program memory, the value of `_label' may be loaded as
|
|---|
| 463 | follows:
|
|---|
| 464 | ldx #_label,16,a ; loads extended bits of _label
|
|---|
| 465 | or #_label,a ; loads lower 16 bits of _label
|
|---|
| 466 | bacc a ; full address is in accumulator A
|
|---|
| 467 |
|
|---|
| 468 |
|
|---|
| 469 | File: as.info, Node: TIC54X-Directives, Next: TIC54X-Macros, Prev: TIC54X-Ext, Up: TIC54X-Dependent
|
|---|
| 470 |
|
|---|
| 471 | Directives
|
|---|
| 472 | ----------
|
|---|
| 473 |
|
|---|
| 474 | `.align [SIZE]'
|
|---|
| 475 | `.even'
|
|---|
| 476 | Align the section program counter on the next boundary, based on
|
|---|
| 477 | SIZE. SIZE may be any power of 2. `.even' is equivalent to
|
|---|
| 478 | `.align' with a SIZE of 2.
|
|---|
| 479 | `1'
|
|---|
| 480 | Align SPC to word boundary
|
|---|
| 481 |
|
|---|
| 482 | `2'
|
|---|
| 483 | Align SPC to longword boundary (same as .even)
|
|---|
| 484 |
|
|---|
| 485 | `128'
|
|---|
| 486 | Align SPC to page boundary
|
|---|
| 487 |
|
|---|
| 488 | `.asg STRING, NAME'
|
|---|
| 489 | Assign NAME the string STRING. String replacement is performed on
|
|---|
| 490 | STRING before assignment.
|
|---|
| 491 |
|
|---|
| 492 | `.eval STRING, NAME'
|
|---|
| 493 | Evaluate the contents of string STRING and assign the result as a
|
|---|
| 494 | string to the subsym NAME. String replacement is performed on
|
|---|
| 495 | STRING before assignment.
|
|---|
| 496 |
|
|---|
| 497 | `.bss SYMBOL, SIZE [, [BLOCKING_FLAG] [,ALIGNMENT_FLAG]]'
|
|---|
| 498 | Reserve space for SYMBOL in the .bss section. SIZE is in words.
|
|---|
| 499 | If present, BLOCKING_FLAG indicates the allocated space should be
|
|---|
| 500 | aligned on a page boundary if it would otherwise cross a page
|
|---|
| 501 | boundary. If present, ALIGNMENT_FLAG causes the assembler to
|
|---|
| 502 | allocate SIZE on a long word boundary.
|
|---|
| 503 |
|
|---|
| 504 | `.byte VALUE [,...,VALUE_N]'
|
|---|
| 505 | `.ubyte VALUE [,...,VALUE_N]'
|
|---|
| 506 | `.char VALUE [,...,VALUE_N]'
|
|---|
| 507 | `.uchar VALUE [,...,VALUE_N]'
|
|---|
| 508 | Place one or more bytes into consecutive words of the current
|
|---|
| 509 | section. The upper 8 bits of each word is zero-filled. If a
|
|---|
| 510 | label is used, it points to the word allocated for the first byte
|
|---|
| 511 | encountered.
|
|---|
| 512 |
|
|---|
| 513 | `.clink ["SECTION_NAME"]'
|
|---|
| 514 | Set STYP_CLINK flag for this section, which indicates to the
|
|---|
| 515 | linker that if no symbols from this section are referenced, the
|
|---|
| 516 | section should not be included in the link. If SECTION_NAME is
|
|---|
| 517 | omitted, the current section is used.
|
|---|
| 518 |
|
|---|
| 519 | `.c_mode'
|
|---|
| 520 | TBD.
|
|---|
| 521 |
|
|---|
| 522 | `.copy "FILENAME" | FILENAME'
|
|---|
| 523 | `.include "FILENAME" | FILENAME'
|
|---|
| 524 | Read source statements from FILENAME. The normal include search
|
|---|
| 525 | path is used. Normally .copy will cause statements from the
|
|---|
| 526 | included file to be printed in the assembly listing and .include
|
|---|
| 527 | will not, but this distinction is not currently implemented.
|
|---|
| 528 |
|
|---|
| 529 | `.data'
|
|---|
| 530 | Begin assembling code into the .data section.
|
|---|
| 531 |
|
|---|
| 532 | `.double VALUE [,...,VALUE_N]'
|
|---|
| 533 | `.ldouble VALUE [,...,VALUE_N]'
|
|---|
| 534 | `.float VALUE [,...,VALUE_N]'
|
|---|
| 535 | `.xfloat VALUE [,...,VALUE_N]'
|
|---|
| 536 | Place an IEEE single-precision floating-point representation of
|
|---|
| 537 | one or more floating-point values into the current section. All
|
|---|
| 538 | but `.xfloat' align the result on a longword boundary. Values are
|
|---|
| 539 | stored most-significant word first.
|
|---|
| 540 |
|
|---|
| 541 | `.drlist'
|
|---|
| 542 | `.drnolist'
|
|---|
| 543 | Control printing of directives to the listing file. Ignored.
|
|---|
| 544 |
|
|---|
| 545 | `.emsg STRING'
|
|---|
| 546 | `.mmsg STRING'
|
|---|
| 547 | `.wmsg STRING'
|
|---|
| 548 | Emit a user-defined error, message, or warning, respectively.
|
|---|
| 549 |
|
|---|
| 550 | `.far_mode'
|
|---|
| 551 | Use extended addressing when assembling statements. This should
|
|---|
| 552 | appear only once per file, and is equivalent to the -mfar-mode
|
|---|
| 553 | option *note `-mfar-mode': TIC54X-Opts..
|
|---|
| 554 |
|
|---|
| 555 | `.fclist'
|
|---|
| 556 | `.fcnolist'
|
|---|
| 557 | Control printing of false conditional blocks to the listing file.
|
|---|
| 558 |
|
|---|
| 559 | `.field VALUE [,SIZE]'
|
|---|
| 560 | Initialize a bitfield of SIZE bits in the current section. If
|
|---|
| 561 | VALUE is relocatable, then SIZE must be 16. SIZE defaults to 16
|
|---|
| 562 | bits. If VALUE does not fit into SIZE bits, the value will be
|
|---|
| 563 | truncated. Successive `.field' directives will pack starting at
|
|---|
| 564 | the current word, filling the most significant bits first, and
|
|---|
| 565 | aligning to the start of the next word if the field size does not
|
|---|
| 566 | fit into the space remaining in the current word. A `.align'
|
|---|
| 567 | directive with an operand of 1 will force the next `.field'
|
|---|
| 568 | directive to begin packing into a new word. If a label is used, it
|
|---|
| 569 | points to the word that contains the specified field.
|
|---|
| 570 |
|
|---|
| 571 | `.global SYMBOL [,...,SYMBOL_N]'
|
|---|
| 572 | `.def SYMBOL [,...,SYMBOL_N]'
|
|---|
| 573 | `.ref SYMBOL [,...,SYMBOL_N]'
|
|---|
| 574 | `.def' nominally identifies a symbol defined in the current file
|
|---|
| 575 | and availalbe to other files. `.ref' identifies a symbol used in
|
|---|
| 576 | the current file but defined elsewhere. Both map to the standard
|
|---|
| 577 | `.global' directive.
|
|---|
| 578 |
|
|---|
| 579 | `.half VALUE [,...,VALUE_N]'
|
|---|
| 580 | `.uhalf VALUE [,...,VALUE_N]'
|
|---|
| 581 | `.short VALUE [,...,VALUE_N]'
|
|---|
| 582 | `.ushort VALUE [,...,VALUE_N]'
|
|---|
| 583 | `.int VALUE [,...,VALUE_N]'
|
|---|
| 584 | `.uint VALUE [,...,VALUE_N]'
|
|---|
| 585 | `.word VALUE [,...,VALUE_N]'
|
|---|
| 586 | `.uword VALUE [,...,VALUE_N]'
|
|---|
| 587 | Place one or more values into consecutive words of the current
|
|---|
| 588 | section. If a label is used, it points to the word allocated for
|
|---|
| 589 | the first value encountered.
|
|---|
| 590 |
|
|---|
| 591 | `.label SYMBOL'
|
|---|
| 592 | Define a special SYMBOL to refer to the load time address of the
|
|---|
| 593 | current section program counter.
|
|---|
| 594 |
|
|---|
| 595 | `.length'
|
|---|
| 596 | `.width'
|
|---|
| 597 | Set the page length and width of the output listing file. Ignored.
|
|---|
| 598 |
|
|---|
| 599 | `.list'
|
|---|
| 600 | `.nolist'
|
|---|
| 601 | Control whether the source listing is printed. Ignored.
|
|---|
| 602 |
|
|---|
| 603 | `.long VALUE [,...,VALUE_N]'
|
|---|
| 604 | `.ulong VALUE [,...,VALUE_N]'
|
|---|
| 605 | `.xlong VALUE [,...,VALUE_N]'
|
|---|
| 606 | Place one or more 32-bit values into consecutive words in the
|
|---|
| 607 | current section. The most significant word is stored first.
|
|---|
| 608 | `.long' and `.ulong' align the result on a longword boundary;
|
|---|
| 609 | `xlong' does not.
|
|---|
| 610 |
|
|---|
| 611 | `.loop [COUNT]'
|
|---|
| 612 | `.break [CONDITION]'
|
|---|
| 613 | `.endloop'
|
|---|
| 614 | Repeatedly assemble a block of code. `.loop' begins the block, and
|
|---|
| 615 | `.endloop' marks its termination. COUNT defaults to 1024, and
|
|---|
| 616 | indicates the number of times the block should be repeated.
|
|---|
| 617 | `.break' terminates the loop so that assembly begins after the
|
|---|
| 618 | `.endloop' directive. The optional CONDITION will cause the loop
|
|---|
| 619 | to terminate only if it evaluates to zero.
|
|---|
| 620 |
|
|---|
| 621 | `MACRO_NAME .macro [PARAM1][,...PARAM_N]'
|
|---|
| 622 | `[.mexit]'
|
|---|
| 623 | `.endm'
|
|---|
| 624 | See the section on macros for more explanation (*Note
|
|---|
| 625 | TIC54X-Macros::.
|
|---|
| 626 |
|
|---|
| 627 | `.mlib "FILENAME" | FILENAME'
|
|---|
| 628 | Load the macro library FILENAME. FILENAME must be an archived
|
|---|
| 629 | library (BFD ar-compatible) of text files, expected to contain
|
|---|
| 630 | only macro definitions. The standard include search path is used.
|
|---|
| 631 |
|
|---|
| 632 | `.mlist'
|
|---|
| 633 |
|
|---|
| 634 | `.mnolist'
|
|---|
| 635 | Control whether to include macro and loop block expansions in the
|
|---|
| 636 | listing output. Ignored.
|
|---|
| 637 |
|
|---|
| 638 | `.mmregs'
|
|---|
| 639 | Define global symbolic names for the 'c54x registers. Supposedly
|
|---|
| 640 | equivalent to executing `.set' directives for each register with
|
|---|
| 641 | its memory-mapped value, but in reality is provided only for
|
|---|
| 642 | compatibility and does nothing.
|
|---|
| 643 |
|
|---|
| 644 | `.newblock'
|
|---|
| 645 | This directive resets any TIC54X local labels currently defined.
|
|---|
| 646 | Normal `as' local labels are unaffected.
|
|---|
| 647 |
|
|---|
| 648 | `.option OPTION_LIST'
|
|---|
| 649 | Set listing options. Ignored.
|
|---|
| 650 |
|
|---|
| 651 | `.sblock "SECTION_NAME" | SECTION_NAME [,"NAME_N" | NAME_N]'
|
|---|
| 652 | Designate SECTION_NAME for blocking. Blocking guarantees that a
|
|---|
| 653 | section will start on a page boundary (128 words) if it would
|
|---|
| 654 | otherwise cross a page boundary. Only initialized sections may be
|
|---|
| 655 | designated with this directive. See also *Note TIC54X-Block::.
|
|---|
| 656 |
|
|---|
| 657 | `.sect "SECTION_NAME"'
|
|---|
| 658 | Define a named initialized section and make it the current section.
|
|---|
| 659 |
|
|---|
| 660 | `SYMBOL .set "VALUE"'
|
|---|
| 661 | `SYMBOL .equ "VALUE"'
|
|---|
| 662 | Equate a constant VALUE to a SYMBOL, which is placed in the symbol
|
|---|
| 663 | table. SYMBOL may not be previously defined.
|
|---|
| 664 |
|
|---|
| 665 | `.space SIZE_IN_BITS'
|
|---|
| 666 | `.bes SIZE_IN_BITS'
|
|---|
| 667 | Reserve the given number of bits in the current section and
|
|---|
| 668 | zero-fill them. If a label is used with `.space', it points to the
|
|---|
| 669 | *first* word reserved. With `.bes', the label points to the
|
|---|
| 670 | *last* word reserved.
|
|---|
| 671 |
|
|---|
| 672 | `.sslist'
|
|---|
| 673 | `.ssnolist'
|
|---|
| 674 | Controls the inclusion of subsym replacement in the listing
|
|---|
| 675 | output. Ignored.
|
|---|
| 676 |
|
|---|
| 677 | `.string "STRING" [,...,"STRING_N"]'
|
|---|
| 678 | `.pstring "STRING" [,...,"STRING_N"]'
|
|---|
| 679 | Place 8-bit characters from STRING into the current section.
|
|---|
| 680 | `.string' zero-fills the upper 8 bits of each word, while
|
|---|
| 681 | `.pstring' puts two characters into each word, filling the
|
|---|
| 682 | most-significant bits first. Unused space is zero-filled. If a
|
|---|
| 683 | label is used, it points to the first word initialized.
|
|---|
| 684 |
|
|---|
| 685 | `[STAG] .struct [OFFSET]'
|
|---|
| 686 | `[NAME_1] element [COUNT_1]'
|
|---|
| 687 | `[NAME_2] element [COUNT_2]'
|
|---|
| 688 | `[TNAME] .tag STAGX [TCOUNT]'
|
|---|
| 689 | `...'
|
|---|
| 690 | `[NAME_N] element [COUNT_N]'
|
|---|
| 691 | `[SSIZE] .endstruct'
|
|---|
| 692 | `LABEL .tag [STAG]'
|
|---|
| 693 | Assign symbolic offsets to the elements of a structure. STAG
|
|---|
| 694 | defines a symbol to use to reference the structure. OFFSET
|
|---|
| 695 | indicates a starting value to use for the first element
|
|---|
| 696 | encountered; otherwise it defaults to zero. Each element can have
|
|---|
| 697 | a named offset, NAME, which is a symbol assigned the value of the
|
|---|
| 698 | element's offset into the structure. If STAG is missing, these
|
|---|
| 699 | become global symbols. COUNT adjusts the offset that many times,
|
|---|
| 700 | as if `element' were an array. `element' may be one of `.byte',
|
|---|
| 701 | `.word', `.long', `.float', or any equivalent of those, and the
|
|---|
| 702 | structure offset is adjusted accordingly. `.field' and `.string'
|
|---|
| 703 | are also allowed; the size of `.field' is one bit, and `.string'
|
|---|
| 704 | is considered to be one word in size. Only element descriptors,
|
|---|
| 705 | structure/union tags, `.align' and conditional assembly directives
|
|---|
| 706 | are allowed within `.struct'/`.endstruct'. `.align' aligns member
|
|---|
| 707 | offsets to word boundaries only. SSIZE, if provided, will always
|
|---|
| 708 | be assigned the size of the structure.
|
|---|
| 709 |
|
|---|
| 710 | The `.tag' directive, in addition to being used to define a
|
|---|
| 711 | structure/union element within a structure, may be used to apply a
|
|---|
| 712 | structure to a symbol. Once applied to LABEL, the individual
|
|---|
| 713 | structure elements may be applied to LABEL to produce the desired
|
|---|
| 714 | offsets using LABEL as the structure base.
|
|---|
| 715 |
|
|---|
| 716 | `.tab'
|
|---|
| 717 | Set the tab size in the output listing. Ignored.
|
|---|
| 718 |
|
|---|
| 719 | `[UTAG] .union'
|
|---|
| 720 | `[NAME_1] element [COUNT_1]'
|
|---|
| 721 | `[NAME_2] element [COUNT_2]'
|
|---|
| 722 | `[TNAME] .tag UTAGX[,TCOUNT]'
|
|---|
| 723 | `...'
|
|---|
| 724 | `[NAME_N] element [COUNT_N]'
|
|---|
| 725 | `[USIZE] .endstruct'
|
|---|
| 726 | `LABEL .tag [UTAG]'
|
|---|
| 727 | Similar to `.struct', but the offset after each element is reset to
|
|---|
| 728 | zero, and the USIZE is set to the maximum of all defined elements.
|
|---|
| 729 | Starting offset for the union is always zero.
|
|---|
| 730 |
|
|---|
| 731 | `[SYMBOL] .usect "SECTION_NAME", SIZE, [,[BLOCKING_FLAG] [,ALIGNMENT_FLAG]]'
|
|---|
| 732 | Reserve space for variables in a named, uninitialized section
|
|---|
| 733 | (similar to .bss). `.usect' allows definitions sections
|
|---|
| 734 | independent of .bss. SYMBOL points to the first location reserved
|
|---|
| 735 | by this allocation. The symbol may be used as a variable name.
|
|---|
| 736 | SIZE is the allocated size in words. BLOCKING_FLAG indicates
|
|---|
| 737 | whether to block this section on a page boundary (128 words)
|
|---|
| 738 | (*note TIC54X-Block::). ALIGNMENT FLAG indicates whether the
|
|---|
| 739 | section should be longword-aligned.
|
|---|
| 740 |
|
|---|
| 741 | `.var SYM[,..., SYM_N]'
|
|---|
| 742 | Define a subsym to be a local variable within a macro. See *Note
|
|---|
| 743 | TIC54X-Macros::.
|
|---|
| 744 |
|
|---|
| 745 | `.version VERSION'
|
|---|
| 746 | Set which processor to build instructions for. Though the
|
|---|
| 747 | following values are accepted, the op is ignored.
|
|---|
| 748 | `541'
|
|---|
| 749 | `542'
|
|---|
| 750 | `543'
|
|---|
| 751 | `545'
|
|---|
| 752 | `545LP'
|
|---|
| 753 | `546LP'
|
|---|
| 754 | `548'
|
|---|
| 755 | `549'
|
|---|
| 756 |
|
|---|
| 757 | File: as.info, Node: TIC54X-Macros, Next: TIC54X-MMRegs, Prev: TIC54X-Directives, Up: TIC54X-Dependent
|
|---|
| 758 |
|
|---|
| 759 | Macros
|
|---|
| 760 | ------
|
|---|
| 761 |
|
|---|
| 762 | Macros do not require explicit dereferencing of arguments (i.e.
|
|---|
| 763 | \ARG).
|
|---|
| 764 |
|
|---|
| 765 | During macro expansion, the macro parameters are converted to
|
|---|
| 766 | subsyms. If the number of arguments passed the macro invocation
|
|---|
| 767 | exceeds the number of parameters defined, the last parameter is
|
|---|
| 768 | assigned the string equivalent of all remaining arguments. If fewer
|
|---|
| 769 | arguments are given than parameters, the missing parameters are
|
|---|
| 770 | assigned empty strings. To include a comma in an argument, you must
|
|---|
| 771 | enclose the argument in quotes.
|
|---|
| 772 |
|
|---|
| 773 | The following built-in subsym functions allow examination of the
|
|---|
| 774 | string value of subsyms (or ordinary strings). The arguments are
|
|---|
| 775 | strings unless otherwise indicated (subsyms passed as args will be
|
|---|
| 776 | replaced by the strings they represent).
|
|---|
| 777 | ``$symlen(STR)''
|
|---|
| 778 | Returns the length of STR.
|
|---|
| 779 |
|
|---|
| 780 | ``$symcmp(STR1,STR2)''
|
|---|
| 781 | Returns 0 if STR1 == STR2, non-zero otherwise.
|
|---|
| 782 |
|
|---|
| 783 | ``$firstch(STR,CH)''
|
|---|
| 784 | Returns index of the first occurrence of character constant CH in
|
|---|
| 785 | STR.
|
|---|
| 786 |
|
|---|
| 787 | ``$lastch(STR,CH)''
|
|---|
| 788 | Returns index of the last occurrence of character constant CH in
|
|---|
| 789 | STR.
|
|---|
| 790 |
|
|---|
| 791 | ``$isdefed(SYMBOL)''
|
|---|
| 792 | Returns zero if the symbol SYMBOL is not in the symbol table,
|
|---|
| 793 | non-zero otherwise.
|
|---|
| 794 |
|
|---|
| 795 | ``$ismember(SYMBOL,LIST)''
|
|---|
| 796 | Assign the first member of comma-separated string LIST to SYMBOL;
|
|---|
| 797 | LIST is reassigned the remainder of the list. Returns zero if
|
|---|
| 798 | LIST is a null string. Both arguments must be subsyms.
|
|---|
| 799 |
|
|---|
| 800 | ``$iscons(EXPR)''
|
|---|
| 801 | Returns 1 if string EXPR is binary, 2 if octal, 3 if hexadecimal,
|
|---|
| 802 | 4 if a character, 5 if decimal, and zero if not an integer.
|
|---|
| 803 |
|
|---|
| 804 | ``$isname(NAME)''
|
|---|
| 805 | Returns 1 if NAME is a valid symbol name, zero otherwise.
|
|---|
| 806 |
|
|---|
| 807 | ``$isreg(REG)''
|
|---|
| 808 | Returns 1 if REG is a valid predefined register name (AR0-AR7
|
|---|
| 809 | only).
|
|---|
| 810 |
|
|---|
| 811 | ``$structsz(STAG)''
|
|---|
| 812 | Returns the size of the structure or union represented by STAG.
|
|---|
| 813 |
|
|---|
| 814 | ``$structacc(STAG)''
|
|---|
| 815 | Returns the reference point of the structure or union represented
|
|---|
| 816 | by STAG. Always returns zero.
|
|---|
| 817 |
|
|---|
| 818 |
|
|---|
| 819 | File: as.info, Node: TIC54X-MMRegs, Prev: TIC54X-Macros, Up: TIC54X-Dependent
|
|---|
| 820 |
|
|---|
| 821 | Memory-mapped Registers
|
|---|
| 822 | -----------------------
|
|---|
| 823 |
|
|---|
| 824 | The following symbols are recognized as memory-mapped registers:
|
|---|
| 825 |
|
|---|
| 826 |
|
|---|
| 827 | File: as.info, Node: Z8000-Dependent, Next: Vax-Dependent, Prev: Xtensa-Dependent, Up: Machine Dependencies
|
|---|
| 828 |
|
|---|
| 829 | Z8000 Dependent Features
|
|---|
| 830 | ========================
|
|---|
| 831 |
|
|---|
| 832 | The Z8000 as supports both members of the Z8000 family: the
|
|---|
| 833 | unsegmented Z8002, with 16 bit addresses, and the segmented Z8001 with
|
|---|
| 834 | 24 bit addresses.
|
|---|
| 835 |
|
|---|
| 836 | When the assembler is in unsegmented mode (specified with the
|
|---|
| 837 | `unsegm' directive), an address takes up one word (16 bit) sized
|
|---|
| 838 | register. When the assembler is in segmented mode (specified with the
|
|---|
| 839 | `segm' directive), a 24-bit address takes up a long (32 bit) register.
|
|---|
| 840 | *Note Assembler Directives for the Z8000: Z8000 Directives, for a list
|
|---|
| 841 | of other Z8000 specific assembler directives.
|
|---|
| 842 |
|
|---|
| 843 | * Menu:
|
|---|
| 844 |
|
|---|
| 845 | * Z8000 Options:: No special command-line options for Z8000
|
|---|
| 846 | * Z8000 Syntax:: Assembler syntax for the Z8000
|
|---|
| 847 | * Z8000 Directives:: Special directives for the Z8000
|
|---|
| 848 | * Z8000 Opcodes:: Opcodes
|
|---|
| 849 |
|
|---|
| 850 |
|
|---|
| 851 | File: as.info, Node: Z8000 Options, Next: Z8000 Syntax, Up: Z8000-Dependent
|
|---|
| 852 |
|
|---|
| 853 | Options
|
|---|
| 854 | -------
|
|---|
| 855 |
|
|---|
| 856 | `as' has no additional command-line options for the Zilog Z8000
|
|---|
| 857 | family.
|
|---|
| 858 |
|
|---|
| 859 |
|
|---|
| 860 | File: as.info, Node: Z8000 Syntax, Next: Z8000 Directives, Prev: Z8000 Options, Up: Z8000-Dependent
|
|---|
| 861 |
|
|---|
| 862 | Syntax
|
|---|
| 863 | ------
|
|---|
| 864 |
|
|---|
| 865 | * Menu:
|
|---|
| 866 |
|
|---|
| 867 | * Z8000-Chars:: Special Characters
|
|---|
| 868 | * Z8000-Regs:: Register Names
|
|---|
| 869 | * Z8000-Addressing:: Addressing Modes
|
|---|
| 870 |
|
|---|
| 871 |
|
|---|
| 872 | File: as.info, Node: Z8000-Chars, Next: Z8000-Regs, Up: Z8000 Syntax
|
|---|
| 873 |
|
|---|
| 874 | Special Characters
|
|---|
| 875 | ..................
|
|---|
| 876 |
|
|---|
| 877 | `!' is the line comment character.
|
|---|
| 878 |
|
|---|
| 879 | You can use `;' instead of a newline to separate statements.
|
|---|
| 880 |
|
|---|
| 881 |
|
|---|
| 882 | File: as.info, Node: Z8000-Regs, Next: Z8000-Addressing, Prev: Z8000-Chars, Up: Z8000 Syntax
|
|---|
| 883 |
|
|---|
| 884 | Register Names
|
|---|
| 885 | ..............
|
|---|
| 886 |
|
|---|
| 887 | The Z8000 has sixteen 16 bit registers, numbered 0 to 15. You can
|
|---|
| 888 | refer to different sized groups of registers by register number, with
|
|---|
| 889 | the prefix `r' for 16 bit registers, `rr' for 32 bit registers and `rq'
|
|---|
| 890 | for 64 bit registers. You can also refer to the contents of the first
|
|---|
| 891 | eight (of the sixteen 16 bit registers) by bytes. They are named `rNh'
|
|---|
| 892 | and `rNl'.
|
|---|
| 893 |
|
|---|
| 894 | _byte registers_
|
|---|
| 895 | r0l r0h r1h r1l r2h r2l r3h r3l
|
|---|
| 896 | r4h r4l r5h r5l r6h r6l r7h r7l
|
|---|
| 897 |
|
|---|
| 898 | _word registers_
|
|---|
| 899 | r0 r1 r2 r3 r4 r5 r6 r7 r8 r9 r10 r11 r12 r13 r14 r15
|
|---|
| 900 |
|
|---|
| 901 | _long word registers_
|
|---|
| 902 | rr0 rr2 rr4 rr6 rr8 rr10 rr12 rr14
|
|---|
| 903 |
|
|---|
| 904 | _quad word registers_
|
|---|
| 905 | rq0 rq4 rq8 rq12
|
|---|
| 906 |
|
|---|
| 907 |
|
|---|
| 908 | File: as.info, Node: Z8000-Addressing, Prev: Z8000-Regs, Up: Z8000 Syntax
|
|---|
| 909 |
|
|---|
| 910 | Addressing Modes
|
|---|
| 911 | ................
|
|---|
| 912 |
|
|---|
| 913 | as understands the following addressing modes for the Z8000:
|
|---|
| 914 |
|
|---|
| 915 | `rN'
|
|---|
| 916 | Register direct
|
|---|
| 917 |
|
|---|
| 918 | `@rN'
|
|---|
| 919 | Indirect register
|
|---|
| 920 |
|
|---|
| 921 | `ADDR'
|
|---|
| 922 | Direct: the 16 bit or 24 bit address (depending on whether the
|
|---|
| 923 | assembler is in segmented or unsegmented mode) of the operand is
|
|---|
| 924 | in the instruction.
|
|---|
| 925 |
|
|---|
| 926 | `address(rN)'
|
|---|
| 927 | Indexed: the 16 or 24 bit address is added to the 16 bit register
|
|---|
| 928 | to produce the final address in memory of the operand.
|
|---|
| 929 |
|
|---|
| 930 | `rN(#IMM)'
|
|---|
| 931 | Base Address: the 16 or 24 bit register is added to the 16 bit sign
|
|---|
| 932 | extended immediate displacement to produce the final address in
|
|---|
| 933 | memory of the operand.
|
|---|
| 934 |
|
|---|
| 935 | `rN(rM)'
|
|---|
| 936 | Base Index: the 16 or 24 bit register rN is added to the sign
|
|---|
| 937 | extended 16 bit index register rM to produce the final address in
|
|---|
| 938 | memory of the operand.
|
|---|
| 939 |
|
|---|
| 940 | `#XX'
|
|---|
| 941 | Immediate data XX.
|
|---|
| 942 |
|
|---|
| 943 |
|
|---|
| 944 | File: as.info, Node: Z8000 Directives, Next: Z8000 Opcodes, Prev: Z8000 Syntax, Up: Z8000-Dependent
|
|---|
| 945 |
|
|---|
| 946 | Assembler Directives for the Z8000
|
|---|
| 947 | ----------------------------------
|
|---|
| 948 |
|
|---|
| 949 | The Z8000 port of as includes these additional assembler directives,
|
|---|
| 950 | for compatibility with other Z8000 assemblers. As shown, these do not
|
|---|
| 951 | begin with `.' (unlike the ordinary as directives).
|
|---|
| 952 |
|
|---|
| 953 | `segm'
|
|---|
| 954 | Generates code for the segmented Z8001.
|
|---|
| 955 |
|
|---|
| 956 | `unsegm'
|
|---|
| 957 | Generates code for the unsegmented Z8002.
|
|---|
| 958 |
|
|---|
| 959 | `name'
|
|---|
| 960 | Synonym for `.file'
|
|---|
| 961 |
|
|---|
| 962 | `global'
|
|---|
| 963 | Synonym for `.global'
|
|---|
| 964 |
|
|---|
| 965 | `wval'
|
|---|
| 966 | Synonym for `.word'
|
|---|
| 967 |
|
|---|
| 968 | `lval'
|
|---|
| 969 | Synonym for `.long'
|
|---|
| 970 |
|
|---|
| 971 | `bval'
|
|---|
| 972 | Synonym for `.byte'
|
|---|
| 973 |
|
|---|
| 974 | `sval'
|
|---|
| 975 | Assemble a string. `sval' expects one string literal, delimited by
|
|---|
| 976 | single quotes. It assembles each byte of the string into
|
|---|
| 977 | consecutive addresses. You can use the escape sequence `%XX'
|
|---|
| 978 | (where XX represents a two-digit hexadecimal number) to represent
|
|---|
| 979 | the character whose ASCII value is XX. Use this feature to
|
|---|
| 980 | describe single quote and other characters that may not appear in
|
|---|
| 981 | string literals as themselves. For example, the C statement
|
|---|
| 982 | `char *a = "he said \"it's 50% off\"";' is represented in Z8000
|
|---|
| 983 | assembly language (shown with the assembler output in hex at the
|
|---|
| 984 | left) as
|
|---|
| 985 |
|
|---|
| 986 | 68652073 sval 'he said %22it%27s 50%25 off%22%00'
|
|---|
| 987 | 61696420
|
|---|
| 988 | 22697427
|
|---|
| 989 | 73203530
|
|---|
| 990 | 25206F66
|
|---|
| 991 | 662200
|
|---|
| 992 |
|
|---|
| 993 | `rsect'
|
|---|
| 994 | synonym for `.section'
|
|---|
| 995 |
|
|---|
| 996 | `block'
|
|---|
| 997 | synonym for `.space'
|
|---|
| 998 |
|
|---|
| 999 | `even'
|
|---|
| 1000 | special case of `.align'; aligns output to even byte boundary.
|
|---|
| 1001 |
|
|---|
| 1002 |
|
|---|
| 1003 | File: as.info, Node: Z8000 Opcodes, Prev: Z8000 Directives, Up: Z8000-Dependent
|
|---|
| 1004 |
|
|---|
| 1005 | Opcodes
|
|---|
| 1006 | -------
|
|---|
| 1007 |
|
|---|
| 1008 | For detailed information on the Z8000 machine instruction set, see
|
|---|
| 1009 | `Z8000 Technical Manual'.
|
|---|
| 1010 |
|
|---|
| 1011 | The following table summarizes the opcodes and their arguments:
|
|---|
| 1012 |
|
|---|
| 1013 | rs 16 bit source register
|
|---|
| 1014 | rd 16 bit destination register
|
|---|
| 1015 | rbs 8 bit source register
|
|---|
| 1016 | rbd 8 bit destination register
|
|---|
| 1017 | rrs 32 bit source register
|
|---|
| 1018 | rrd 32 bit destination register
|
|---|
| 1019 | rqs 64 bit source register
|
|---|
| 1020 | rqd 64 bit destination register
|
|---|
| 1021 | addr 16/24 bit address
|
|---|
| 1022 | imm immediate data
|
|---|
| 1023 |
|
|---|
| 1024 | adc rd,rs clrb addr cpsir @rd,@rs,rr,cc
|
|---|
| 1025 | adcb rbd,rbs clrb addr(rd) cpsirb @rd,@rs,rr,cc
|
|---|
| 1026 | add rd,@rs clrb rbd dab rbd
|
|---|
| 1027 | add rd,addr com @rd dbjnz rbd,disp7
|
|---|
| 1028 | add rd,addr(rs) com addr dec @rd,imm4m1
|
|---|
| 1029 | add rd,imm16 com addr(rd) dec addr(rd),imm4m1
|
|---|
| 1030 | add rd,rs com rd dec addr,imm4m1
|
|---|
| 1031 | addb rbd,@rs comb @rd dec rd,imm4m1
|
|---|
| 1032 | addb rbd,addr comb addr decb @rd,imm4m1
|
|---|
| 1033 | addb rbd,addr(rs) comb addr(rd) decb addr(rd),imm4m1
|
|---|
| 1034 | addb rbd,imm8 comb rbd decb addr,imm4m1
|
|---|
| 1035 | addb rbd,rbs comflg flags decb rbd,imm4m1
|
|---|
| 1036 | addl rrd,@rs cp @rd,imm16 di i2
|
|---|
| 1037 | addl rrd,addr cp addr(rd),imm16 div rrd,@rs
|
|---|
| 1038 | addl rrd,addr(rs) cp addr,imm16 div rrd,addr
|
|---|
| 1039 | addl rrd,imm32 cp rd,@rs div rrd,addr(rs)
|
|---|
| 1040 | addl rrd,rrs cp rd,addr div rrd,imm16
|
|---|
| 1041 | and rd,@rs cp rd,addr(rs) div rrd,rs
|
|---|
| 1042 | and rd,addr cp rd,imm16 divl rqd,@rs
|
|---|
| 1043 | and rd,addr(rs) cp rd,rs divl rqd,addr
|
|---|
| 1044 | and rd,imm16 cpb @rd,imm8 divl rqd,addr(rs)
|
|---|
| 1045 | and rd,rs cpb addr(rd),imm8 divl rqd,imm32
|
|---|
| 1046 | andb rbd,@rs cpb addr,imm8 divl rqd,rrs
|
|---|
| 1047 | andb rbd,addr cpb rbd,@rs djnz rd,disp7
|
|---|
| 1048 | andb rbd,addr(rs) cpb rbd,addr ei i2
|
|---|
| 1049 | andb rbd,imm8 cpb rbd,addr(rs) ex rd,@rs
|
|---|
| 1050 | andb rbd,rbs cpb rbd,imm8 ex rd,addr
|
|---|
| 1051 | bit @rd,imm4 cpb rbd,rbs ex rd,addr(rs)
|
|---|
| 1052 | bit addr(rd),imm4 cpd rd,@rs,rr,cc ex rd,rs
|
|---|
| 1053 | bit addr,imm4 cpdb rbd,@rs,rr,cc exb rbd,@rs
|
|---|
| 1054 | bit rd,imm4 cpdr rd,@rs,rr,cc exb rbd,addr
|
|---|
| 1055 | bit rd,rs cpdrb rbd,@rs,rr,cc exb rbd,addr(rs)
|
|---|
| 1056 | bitb @rd,imm4 cpi rd,@rs,rr,cc exb rbd,rbs
|
|---|
| 1057 | bitb addr(rd),imm4 cpib rbd,@rs,rr,cc ext0e imm8
|
|---|
| 1058 | bitb addr,imm4 cpir rd,@rs,rr,cc ext0f imm8
|
|---|
| 1059 | bitb rbd,imm4 cpirb rbd,@rs,rr,cc ext8e imm8
|
|---|
| 1060 | bitb rbd,rs cpl rrd,@rs ext8f imm8
|
|---|
| 1061 | bpt cpl rrd,addr exts rrd
|
|---|
| 1062 | call @rd cpl rrd,addr(rs) extsb rd
|
|---|
| 1063 | call addr cpl rrd,imm32 extsl rqd
|
|---|
| 1064 | call addr(rd) cpl rrd,rrs halt
|
|---|
| 1065 | calr disp12 cpsd @rd,@rs,rr,cc in rd,@rs
|
|---|
| 1066 | clr @rd cpsdb @rd,@rs,rr,cc in rd,imm16
|
|---|
| 1067 | clr addr cpsdr @rd,@rs,rr,cc inb rbd,@rs
|
|---|
| 1068 | clr addr(rd) cpsdrb @rd,@rs,rr,cc inb rbd,imm16
|
|---|
| 1069 | clr rd cpsi @rd,@rs,rr,cc inc @rd,imm4m1
|
|---|
| 1070 | clrb @rd cpsib @rd,@rs,rr,cc inc addr(rd),imm4m1
|
|---|
| 1071 | inc addr,imm4m1 ldb rbd,rs(rx) mult rrd,addr(rs)
|
|---|
| 1072 | inc rd,imm4m1 ldb rd(imm16),rbs mult rrd,imm16
|
|---|
| 1073 | incb @rd,imm4m1 ldb rd(rx),rbs mult rrd,rs
|
|---|
| 1074 | incb addr(rd),imm4m1 ldctl ctrl,rs multl rqd,@rs
|
|---|
| 1075 | incb addr,imm4m1 ldctl rd,ctrl multl rqd,addr
|
|---|
| 1076 | incb rbd,imm4m1 ldd @rs,@rd,rr multl rqd,addr(rs)
|
|---|
| 1077 | ind @rd,@rs,ra lddb @rs,@rd,rr multl rqd,imm32
|
|---|
| 1078 | indb @rd,@rs,rba lddr @rs,@rd,rr multl rqd,rrs
|
|---|
| 1079 | inib @rd,@rs,ra lddrb @rs,@rd,rr neg @rd
|
|---|
| 1080 | inibr @rd,@rs,ra ldi @rd,@rs,rr neg addr
|
|---|
| 1081 | iret ldib @rd,@rs,rr neg addr(rd)
|
|---|
| 1082 | jp cc,@rd ldir @rd,@rs,rr neg rd
|
|---|
| 1083 | jp cc,addr ldirb @rd,@rs,rr negb @rd
|
|---|
| 1084 | jp cc,addr(rd) ldk rd,imm4 negb addr
|
|---|
| 1085 | jr cc,disp8 ldl @rd,rrs negb addr(rd)
|
|---|
| 1086 | ld @rd,imm16 ldl addr(rd),rrs negb rbd
|
|---|
| 1087 | ld @rd,rs ldl addr,rrs nop
|
|---|
| 1088 | ld addr(rd),imm16 ldl rd(imm16),rrs or rd,@rs
|
|---|
| 1089 | ld addr(rd),rs ldl rd(rx),rrs or rd,addr
|
|---|
| 1090 | ld addr,imm16 ldl rrd,@rs or rd,addr(rs)
|
|---|
| 1091 | ld addr,rs ldl rrd,addr or rd,imm16
|
|---|
| 1092 | ld rd(imm16),rs ldl rrd,addr(rs) or rd,rs
|
|---|
| 1093 | ld rd(rx),rs ldl rrd,imm32 orb rbd,@rs
|
|---|
| 1094 | ld rd,@rs ldl rrd,rrs orb rbd,addr
|
|---|
| 1095 | ld rd,addr ldl rrd,rs(imm16) orb rbd,addr(rs)
|
|---|
| 1096 | ld rd,addr(rs) ldl rrd,rs(rx) orb rbd,imm8
|
|---|
| 1097 | ld rd,imm16 ldm @rd,rs,n orb rbd,rbs
|
|---|
| 1098 | ld rd,rs ldm addr(rd),rs,n out @rd,rs
|
|---|
| 1099 | ld rd,rs(imm16) ldm addr,rs,n out imm16,rs
|
|---|
| 1100 | ld rd,rs(rx) ldm rd,@rs,n outb @rd,rbs
|
|---|
| 1101 | lda rd,addr ldm rd,addr(rs),n outb imm16,rbs
|
|---|
| 1102 | lda rd,addr(rs) ldm rd,addr,n outd @rd,@rs,ra
|
|---|
| 1103 | lda rd,rs(imm16) ldps @rs outdb @rd,@rs,rba
|
|---|
| 1104 | lda rd,rs(rx) ldps addr outib @rd,@rs,ra
|
|---|
| 1105 | ldar rd,disp16 ldps addr(rs) outibr @rd,@rs,ra
|
|---|
| 1106 | ldb @rd,imm8 ldr disp16,rs pop @rd,@rs
|
|---|
| 1107 | ldb @rd,rbs ldr rd,disp16 pop addr(rd),@rs
|
|---|
| 1108 | ldb addr(rd),imm8 ldrb disp16,rbs pop addr,@rs
|
|---|
| 1109 | ldb addr(rd),rbs ldrb rbd,disp16 pop rd,@rs
|
|---|
| 1110 | ldb addr,imm8 ldrl disp16,rrs popl @rd,@rs
|
|---|
| 1111 | ldb addr,rbs ldrl rrd,disp16 popl addr(rd),@rs
|
|---|
| 1112 | ldb rbd,@rs mbit popl addr,@rs
|
|---|
| 1113 | ldb rbd,addr mreq rd popl rrd,@rs
|
|---|
| 1114 | ldb rbd,addr(rs) mres push @rd,@rs
|
|---|
| 1115 | ldb rbd,imm8 mset push @rd,addr
|
|---|
| 1116 | ldb rbd,rbs mult rrd,@rs push @rd,addr(rs)
|
|---|
| 1117 | ldb rbd,rs(imm16) mult rrd,addr push @rd,imm16
|
|---|
| 1118 | push @rd,rs set addr,imm4 subl rrd,imm32
|
|---|
| 1119 | pushl @rd,@rs set rd,imm4 subl rrd,rrs
|
|---|
| 1120 | pushl @rd,addr set rd,rs tcc cc,rd
|
|---|
| 1121 | pushl @rd,addr(rs) setb @rd,imm4 tccb cc,rbd
|
|---|
| 1122 | pushl @rd,rrs setb addr(rd),imm4 test @rd
|
|---|
| 1123 | res @rd,imm4 setb addr,imm4 test addr
|
|---|
| 1124 | res addr(rd),imm4 setb rbd,imm4 test addr(rd)
|
|---|
| 1125 | res addr,imm4 setb rbd,rs test rd
|
|---|
| 1126 | res rd,imm4 setflg imm4 testb @rd
|
|---|
| 1127 | res rd,rs sinb rbd,imm16 testb addr
|
|---|
| 1128 | resb @rd,imm4 sinb rd,imm16 testb addr(rd)
|
|---|
| 1129 | resb addr(rd),imm4 sind @rd,@rs,ra testb rbd
|
|---|
| 1130 | resb addr,imm4 sindb @rd,@rs,rba testl @rd
|
|---|
| 1131 | resb rbd,imm4 sinib @rd,@rs,ra testl addr
|
|---|
| 1132 | resb rbd,rs sinibr @rd,@rs,ra testl addr(rd)
|
|---|
| 1133 | resflg imm4 sla rd,imm8 testl rrd
|
|---|
| 1134 | ret cc slab rbd,imm8 trdb @rd,@rs,rba
|
|---|
| 1135 | rl rd,imm1or2 slal rrd,imm8 trdrb @rd,@rs,rba
|
|---|
| 1136 | rlb rbd,imm1or2 sll rd,imm8 trib @rd,@rs,rbr
|
|---|
| 1137 | rlc rd,imm1or2 sllb rbd,imm8 trirb @rd,@rs,rbr
|
|---|
| 1138 | rlcb rbd,imm1or2 slll rrd,imm8 trtdrb @ra,@rb,rbr
|
|---|
| 1139 | rldb rbb,rba sout imm16,rs trtib @ra,@rb,rr
|
|---|
| 1140 | rr rd,imm1or2 soutb imm16,rbs trtirb @ra,@rb,rbr
|
|---|
| 1141 | rrb rbd,imm1or2 soutd @rd,@rs,ra trtrb @ra,@rb,rbr
|
|---|
| 1142 | rrc rd,imm1or2 soutdb @rd,@rs,rba tset @rd
|
|---|
| 1143 | rrcb rbd,imm1or2 soutib @rd,@rs,ra tset addr
|
|---|
| 1144 | rrdb rbb,rba soutibr @rd,@rs,ra tset addr(rd)
|
|---|
| 1145 | rsvd36 sra rd,imm8 tset rd
|
|---|
| 1146 | rsvd38 srab rbd,imm8 tsetb @rd
|
|---|
| 1147 | rsvd78 sral rrd,imm8 tsetb addr
|
|---|
| 1148 | rsvd7e srl rd,imm8 tsetb addr(rd)
|
|---|
| 1149 | rsvd9d srlb rbd,imm8 tsetb rbd
|
|---|
| 1150 | rsvd9f srll rrd,imm8 xor rd,@rs
|
|---|
| 1151 | rsvdb9 sub rd,@rs xor rd,addr
|
|---|
| 1152 | rsvdbf sub rd,addr xor rd,addr(rs)
|
|---|
| 1153 | sbc rd,rs sub rd,addr(rs) xor rd,imm16
|
|---|
| 1154 | sbcb rbd,rbs sub rd,imm16 xor rd,rs
|
|---|
| 1155 | sc imm8 sub rd,rs xorb rbd,@rs
|
|---|
| 1156 | sda rd,rs subb rbd,@rs xorb rbd,addr
|
|---|
| 1157 | sdab rbd,rs subb rbd,addr xorb rbd,addr(rs)
|
|---|
| 1158 | sdal rrd,rs subb rbd,addr(rs) xorb rbd,imm8
|
|---|
| 1159 | sdl rd,rs subb rbd,imm8 xorb rbd,rbs
|
|---|
| 1160 | sdlb rbd,rs subb rbd,rbs xorb rbd,rbs
|
|---|
| 1161 | sdll rrd,rs subl rrd,@rs
|
|---|
| 1162 | set @rd,imm4 subl rrd,addr
|
|---|
| 1163 | set addr(rd),imm4 subl rrd,addr(rs)
|
|---|
| 1164 |
|
|---|
| 1165 |
|
|---|
| 1166 | File: as.info, Node: Vax-Dependent, Prev: Z8000-Dependent, Up: Machine Dependencies
|
|---|
| 1167 |
|
|---|
| 1168 | VAX Dependent Features
|
|---|
| 1169 | ======================
|
|---|
| 1170 |
|
|---|
| 1171 | * Menu:
|
|---|
| 1172 |
|
|---|
| 1173 | * VAX-Opts:: VAX Command-Line Options
|
|---|
| 1174 | * VAX-float:: VAX Floating Point
|
|---|
| 1175 | * VAX-directives:: Vax Machine Directives
|
|---|
| 1176 | * VAX-opcodes:: VAX Opcodes
|
|---|
| 1177 | * VAX-branch:: VAX Branch Improvement
|
|---|
| 1178 | * VAX-operands:: VAX Operands
|
|---|
| 1179 | * VAX-no:: Not Supported on VAX
|
|---|
| 1180 |
|
|---|
| 1181 |
|
|---|
| 1182 | File: as.info, Node: VAX-Opts, Next: VAX-float, Up: Vax-Dependent
|
|---|
| 1183 |
|
|---|
| 1184 | VAX Command-Line Options
|
|---|
| 1185 | ------------------------
|
|---|
| 1186 |
|
|---|
| 1187 | The Vax version of `as' accepts any of the following options, gives
|
|---|
| 1188 | a warning message that the option was ignored and proceeds. These
|
|---|
| 1189 | options are for compatibility with scripts designed for other people's
|
|---|
| 1190 | assemblers.
|
|---|
| 1191 |
|
|---|
| 1192 | ``-D' (Debug)'
|
|---|
| 1193 | ``-S' (Symbol Table)'
|
|---|
| 1194 | ``-T' (Token Trace)'
|
|---|
| 1195 | These are obsolete options used to debug old assemblers.
|
|---|
| 1196 |
|
|---|
| 1197 | ``-d' (Displacement size for JUMPs)'
|
|---|
| 1198 | This option expects a number following the `-d'. Like options
|
|---|
| 1199 | that expect filenames, the number may immediately follow the `-d'
|
|---|
| 1200 | (old standard) or constitute the whole of the command line
|
|---|
| 1201 | argument that follows `-d' (GNU standard).
|
|---|
| 1202 |
|
|---|
| 1203 | ``-V' (Virtualize Interpass Temporary File)'
|
|---|
| 1204 | Some other assemblers use a temporary file. This option commanded
|
|---|
| 1205 | them to keep the information in active memory rather than in a
|
|---|
| 1206 | disk file. `as' always does this, so this option is redundant.
|
|---|
| 1207 |
|
|---|
| 1208 | ``-J' (JUMPify Longer Branches)'
|
|---|
| 1209 | Many 32-bit computers permit a variety of branch instructions to
|
|---|
| 1210 | do the same job. Some of these instructions are short (and fast)
|
|---|
| 1211 | but have a limited range; others are long (and slow) but can
|
|---|
| 1212 | branch anywhere in virtual memory. Often there are 3 flavors of
|
|---|
| 1213 | branch: short, medium and long. Some other assemblers would emit
|
|---|
| 1214 | short and medium branches, unless told by this option to emit
|
|---|
| 1215 | short and long branches.
|
|---|
| 1216 |
|
|---|
| 1217 | ``-t' (Temporary File Directory)'
|
|---|
| 1218 | Some other assemblers may use a temporary file, and this option
|
|---|
| 1219 | takes a filename being the directory to site the temporary file.
|
|---|
| 1220 | Since `as' does not use a temporary disk file, this option makes
|
|---|
| 1221 | no difference. `-t' needs exactly one filename.
|
|---|
| 1222 |
|
|---|
| 1223 | The Vax version of the assembler accepts additional options when
|
|---|
| 1224 | compiled for VMS:
|
|---|
| 1225 |
|
|---|
| 1226 | `-h N'
|
|---|
| 1227 | External symbol or section (used for global variables) names are
|
|---|
| 1228 | not case sensitive on VAX/VMS and always mapped to upper case.
|
|---|
| 1229 | This is contrary to the C language definition which explicitly
|
|---|
| 1230 | distinguishes upper and lower case. To implement a standard
|
|---|
| 1231 | conforming C compiler, names must be changed (mapped) to preserve
|
|---|
| 1232 | the case information. The default mapping is to convert all lower
|
|---|
| 1233 | case characters to uppercase and adding an underscore followed by
|
|---|
| 1234 | a 6 digit hex value, representing a 24 digit binary value. The
|
|---|
| 1235 | one digits in the binary value represent which characters are
|
|---|
| 1236 | uppercase in the original symbol name.
|
|---|
| 1237 |
|
|---|
| 1238 | The `-h N' option determines how we map names. This takes several
|
|---|
| 1239 | values. No `-h' switch at all allows case hacking as described
|
|---|
| 1240 | above. A value of zero (`-h0') implies names should be upper
|
|---|
| 1241 | case, and inhibits the case hack. A value of 2 (`-h2') implies
|
|---|
| 1242 | names should be all lower case, with no case hack. A value of 3
|
|---|
| 1243 | (`-h3') implies that case should be preserved. The value 1 is
|
|---|
| 1244 | unused. The `-H' option directs `as' to display every mapped
|
|---|
| 1245 | symbol during assembly.
|
|---|
| 1246 |
|
|---|
| 1247 | Symbols whose names include a dollar sign `$' are exceptions to the
|
|---|
| 1248 | general name mapping. These symbols are normally only used to
|
|---|
| 1249 | reference VMS library names. Such symbols are always mapped to
|
|---|
| 1250 | upper case.
|
|---|
| 1251 |
|
|---|
| 1252 | `-+'
|
|---|
| 1253 | The `-+' option causes `as' to truncate any symbol name larger
|
|---|
| 1254 | than 31 characters. The `-+' option also prevents some code
|
|---|
| 1255 | following the `_main' symbol normally added to make the object
|
|---|
| 1256 | file compatible with Vax-11 "C".
|
|---|
| 1257 |
|
|---|
| 1258 | `-1'
|
|---|
| 1259 | This option is ignored for backward compatibility with `as'
|
|---|
| 1260 | version 1.x.
|
|---|
| 1261 |
|
|---|
| 1262 | `-H'
|
|---|
| 1263 | The `-H' option causes `as' to print every symbol which was
|
|---|
| 1264 | changed by case mapping.
|
|---|
| 1265 |
|
|---|
| 1266 |
|
|---|
| 1267 | File: as.info, Node: VAX-float, Next: VAX-directives, Prev: VAX-Opts, Up: Vax-Dependent
|
|---|
| 1268 |
|
|---|
| 1269 | VAX Floating Point
|
|---|
| 1270 | ------------------
|
|---|
| 1271 |
|
|---|
| 1272 | Conversion of flonums to floating point is correct, and compatible
|
|---|
| 1273 | with previous assemblers. Rounding is towards zero if the remainder is
|
|---|
| 1274 | exactly half the least significant bit.
|
|---|
| 1275 |
|
|---|
| 1276 | `D', `F', `G' and `H' floating point formats are understood.
|
|---|
| 1277 |
|
|---|
| 1278 | Immediate floating literals (_e.g._ `S`$6.9') are rendered
|
|---|
| 1279 | correctly. Again, rounding is towards zero in the boundary case.
|
|---|
| 1280 |
|
|---|
| 1281 | The `.float' directive produces `f' format numbers. The `.double'
|
|---|
| 1282 | directive produces `d' format numbers.
|
|---|
| 1283 |
|
|---|
| 1284 |
|
|---|
| 1285 | File: as.info, Node: VAX-directives, Next: VAX-opcodes, Prev: VAX-float, Up: Vax-Dependent
|
|---|
| 1286 |
|
|---|
| 1287 | Vax Machine Directives
|
|---|
| 1288 | ----------------------
|
|---|
| 1289 |
|
|---|
| 1290 | The Vax version of the assembler supports four directives for
|
|---|
| 1291 | generating Vax floating point constants. They are described in the
|
|---|
| 1292 | table below.
|
|---|
| 1293 |
|
|---|
| 1294 | `.dfloat'
|
|---|
| 1295 | This expects zero or more flonums, separated by commas, and
|
|---|
| 1296 | assembles Vax `d' format 64-bit floating point constants.
|
|---|
| 1297 |
|
|---|
| 1298 | `.ffloat'
|
|---|
| 1299 | This expects zero or more flonums, separated by commas, and
|
|---|
| 1300 | assembles Vax `f' format 32-bit floating point constants.
|
|---|
| 1301 |
|
|---|
| 1302 | `.gfloat'
|
|---|
| 1303 | This expects zero or more flonums, separated by commas, and
|
|---|
| 1304 | assembles Vax `g' format 64-bit floating point constants.
|
|---|
| 1305 |
|
|---|
| 1306 | `.hfloat'
|
|---|
| 1307 | This expects zero or more flonums, separated by commas, and
|
|---|
| 1308 | assembles Vax `h' format 128-bit floating point constants.
|
|---|
| 1309 |
|
|---|
| 1310 |
|
|---|
| 1311 | File: as.info, Node: VAX-opcodes, Next: VAX-branch, Prev: VAX-directives, Up: Vax-Dependent
|
|---|
| 1312 |
|
|---|
| 1313 | VAX Opcodes
|
|---|
| 1314 | -----------
|
|---|
| 1315 |
|
|---|
| 1316 | All DEC mnemonics are supported. Beware that `case...' instructions
|
|---|
| 1317 | have exactly 3 operands. The dispatch table that follows the `case...'
|
|---|
| 1318 | instruction should be made with `.word' statements. This is compatible
|
|---|
| 1319 | with all unix assemblers we know of.
|
|---|
| 1320 |
|
|---|