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

You also want an ePaper? Increase the reach of your titles

YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.

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

Branch Instructions<br />

The <strong>XENIX</strong> assembler has a new class of instructions, called branch instructions, that<br />

test a condition and branch to an instruction address further than 128 bytes away.<br />

These instructions take the same kind of operand as the normal jmp instruction but<br />

provide a test to see whether or not the jump should occur. The following is a list of the<br />

branch instructions.<br />

beq<br />

bge<br />

bgt<br />

bhi<br />

bhis<br />

ble<br />

blo<br />

blos<br />

blt<br />

bne<br />

br<br />

The branch instructions, when assembled, consist of two 80<strong>86</strong>/<strong>2<strong>86</strong></strong> jump instructions. The<br />

first jump tests for the inverse of the condition specified by the branch. The second<br />

jump is the unconditional jump instruction jmp. If the branch condition is true, the first<br />

jump is ignored and the second jump taken. If the branch condition is false, the first<br />

jump is taken. The first jump passes control to the next statement after the second<br />

jump.<br />

For example, the statement<br />

bne subtest<br />

is equivalent to the statements<br />

no:<br />

je no<br />

jmp subtest<br />

String Instructions<br />

The <strong>XENIX</strong> assembler uses a subset of the string instructions normally available for the<br />

80<strong>86</strong>/<strong>2<strong>86</strong></strong> processor. In particular, the assembler accepts only those string instructions<br />

that do not take operands. These are essentially the byte and word forms of the string<br />

instructions with implied destination.<br />

To indicate this restriction, some instruction mnemonics no longer contain the "s" for<br />

string. The following is a list of the string instructions:<br />

cmpsb<br />

cmps<br />

lodb<br />

lodw<br />

movsb<br />

movs<br />

scab<br />

scaw<br />

stob<br />

stow<br />

The assembler also accepts the rep, repnz, and repz instructions for repeating string<br />

operations. Note that these instructions must appear alone on a line; they cannot be<br />

combined on the same line with a string instruction.<br />

7-17

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

Saved successfully!

Ooh no, something went wrong!