09.06.2013 Views

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

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

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

SHOW MORE
SHOW LESS

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

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

Instructions and data definitions with initial values must not be used after a .bss<br />

directive, but symbols may be defined and dot moved by assignment.<br />

If no explicit segment directive is given in a program, code is copied to the text<br />

segment.<br />

Common Directive<br />

.comm name [, expression<br />

The .comm directive makes name globally known to all files of the program. If name<br />

also appears in an assignment or as a label in a file, then the .comm directive has the<br />

same effect as the .globl directive. In this case, any expression given is ignored. If<br />

name does not have an explicit definition, then .comm directs the <strong>XENIX</strong> linker to<br />

automatically allocate expression bytes for name in the bss segment of the program.<br />

These bytes appear before any bytes specifically allocated within the bss segment.<br />

Insert Directive<br />

.insrt "filename"<br />

The .insrt directive directs the assembler to suspend processing of the current file until<br />

all statements in the given file have been read. filename must be enclosed within<br />

double quotation marks. If the file cannot be opened or does not exist, the assembler<br />

displays the message<br />

Cannot open insert file<br />

Otherwise, it reads the contents of the file. The file may contain other .insrt<br />

directives; up to ten levels of directives may be nested in this way.<br />

The .insrt directive is useful for including a standard set of comments or symbol<br />

assignments at the beginning of a program, e.g., the definitions for system calls found in<br />

the file /usr/include/sys.s. The directive is also useful for breaking up a large source<br />

program into easily manageable pieces.<br />

ASCII Directives<br />

.ascii /string/<br />

.asciz /string/<br />

The .ascii and .asciz directives translate string into an equivalent sequence of ASCII<br />

byte values and copy these bytes to allocated storage in the current segment. The<br />

.asciz directive also appends a null byte to the end of the sequence.<br />

7-10

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

Saved successfully!

Ooh no, something went wrong!