Intel XENIX 286 Programmers Guide (86) - Tenox.tc

Intel XENIX 286 Programmers Guide (86) - Tenox.tc Intel XENIX 286 Programmers Guide (86) - Tenox.tc

09.06.2013 Views

XENIX Programming as: Assembler The string may contain any character in the character set except a newline. If necessary, the escape sequence "\n" may be used in place of a newline. The string must be enclosed within slashes (/) or within any character not used in the string. Examples: .ascii /"hello there"/ .ascii "Warning- 07 07 \n " .asciz *abcdefg* The .asciz directive is especially useful because some system calls and many library routines require null-terminated strings as arguments. Strings are normally nullterminated in C programs, and any string constant in a C program is stored with a terminating null, appended by the compiler. Listing Directives .list .nlist The .list and .nlist directives control output to the assembler listing file created by using the -1 option. If .list is given, subsequent statements are passed to the listing file as well as being processed. If .nlist is given, statements are processed but not passed to the listing file. The directives may be used any number of times to turn listing on and off. This is particularly useful when certain portions of the assembly output are not desired on a printed listing. Block Directives .blkb [expression . bl kw [ expression The .blkb and .blkw directives reserve blocks of storage where a block contains expression bytes (for .blkb) or expression words (for .blkw). If no expression is given, 1 is assu med. The expression must be absolute and defined during pass 1. Note that the statement . = . + expression may also be used to reserve blocks of storage. In this case, the block contains expression bytes. 7-11

as: Assembler Initial Value Directives . byte . word [ expression ] .. . [ expression ] .. . XENIX Programming The .byte and .word directives reserve storage and initialize this storage to the value given by the expressions. The .byte directive reserves one byte for each expression and initializes that byte to the low-order byte of the expression. The .word directive reserves one word for each expression and initializes that word to the value of expression. When more than one expression is given, they must be separated by commas (,). End Directive .end [ expression ] The .end directive marks the physical end of the source program. If expression is given, it indicates the entry point of the program, i.e., the starting point for execution. Otherwise, the entry point is taken to be the start of the text segment. Note that inserted files that contain an .end directive terminate assembly of the entire program as well as the inserted portion. Machine Instructions This section presents a description of the 8086/286 instructions used by the XENIX 8086/286 assembler. This assembler supports those instructions common to the 8086 and 80286 processors, i.e., all 8086 instructions. This assembler does not support those instructions that are specific to the 80286 assembler. 80286-specific instructions can be defined by users either in nu meric form or with a macro processor. Mnemonic List This section contains a list of the instruction mnemonics (instruction names) used by the 8086/286 assembler as. Some of these mnemonics are different from those used by other 8086/286 assemblers. Mnemonics marked with an asterisk may be specific to this asse mbler. 7-12

<strong>XENIX</strong> Programming as: Assembler<br />

The string may contain any character in the character set except a newline. If<br />

necessary, the escape sequence "\n" may be used in place of a newline. The string must<br />

be enclosed within slashes (/) or within any character not used in the string. Examples:<br />

.ascii /"hello there"/<br />

.ascii "Warning- 07 07 \n "<br />

.asciz *abcdefg*<br />

The .asciz directive is especially useful because some system calls and many library<br />

routines require null-terminated strings as arguments. Strings are normally nullterminated<br />

in C programs, and any string constant in a C program is stored with a<br />

terminating null, appended by the compiler.<br />

Listing Directives<br />

.list<br />

.nlist<br />

The .list and .nlist directives control output to the assembler listing file created by<br />

using the -1 option. If .list is given, subsequent statements are passed to the listing file<br />

as well as being processed. If .nlist is given, statements are processed but not passed to<br />

the listing file.<br />

The directives may be used any number of times to turn listing on and off. This is<br />

particularly useful when certain portions of the assembly output are not desired on a<br />

printed listing.<br />

Block Directives<br />

.blkb [expression<br />

. bl kw [ expression<br />

The .blkb and .blkw directives reserve blocks of storage where a block contains<br />

expression bytes (for .blkb) or expression words (for .blkw). If no expression is given, 1<br />

is assu med. The expression must be absolute and defined during pass 1.<br />

Note that the statement<br />

. = . + expression<br />

may also be used to reserve blocks of storage. In this case, the block contains<br />

expression bytes.<br />

7-11

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!