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 Based Operands Based operands are bytes or words in memory with addresses computed by adding a constant and one of the base registers bp or bx. The operands have the forms expression ] (bp) expression ] (bx) where expression is an absolute expression or symbol that resolves to an absolute. Based operands are typically used to access structures. The base register points to the start of the structure, and items in the structure are addressed by an appropriate expression. The following examples illustrate based operands: mov 2(bp), #1000 movb ax, TOP (bx) neg -4 (bp) mov ax, (bx) (bp) Indexed Operands Indexed operands are bytes or words in memory with addresses computed by adding a constant and one of the index registers di or si. The operands have the forms expression (di) expression (si) where expression is an absolute expression or symbol that resolves to an absolute. Indexed operands are often used to access elements in an array. expression points to the start of the array. The index register is given the index value of the elem ent to be accessed. Since all array elements are the same length, simple arithmetic on the index register will select any element. The following examples illustrate indexed operands: movb ax,Darray(di) addb 4096(si), * 1 7-2 1

as: A sse m bier XENIX Programming Based Indexed Operands Based indexed operands are bytes or words in memory whose addresses are computed by adding a constant, a base register, and an index register. The operands have the forms expression ] (bx) (di) expression ] (bx) (si) expression ] (bp) (di) expression ] (bp) (si) where expression is an absolute expression or a symbol that resolves to an absolute. Based indexed operands provide a very flexible method of accessing items that require two address components. For example, elements of multidimensional arrays can be accessed by setting expression to the start address of the array and assigning the appropriately scaled index values to the base and index registers. The following examples illustrate based indexed operands: movb Darray (bx) (di), * 1 mov ax, (bx) (si) neg -2 (bp) (si) Indirect Address Operands Indirect address operands are instruction addresses stored in memory at given indirect addresses. Indirect address operands have the form @expression where expression is an absolute expression or a symbol that resolves to an absolute. Indirect address operands may be used only with the calli, call, jmpi, and jmp instructions. When used with the intersegment call or jump instruction, expression must point to a 4-byte segment/offset instruction address. When used with the call or jump instruction, expression must point to a 2-byte offset to an instruction. The following examples illustrate indirect address operands: 7-22 moncall: .word .word subtest': .word .text examp: calli jmp OFFSET SEG SELECT OFFSET @moncall @subtest

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

Based Operands<br />

Based operands are bytes or words in memory with addresses computed by adding a<br />

constant and one of the base registers bp or bx. The operands have the forms<br />

expression ] (bp)<br />

expression ] (bx)<br />

where expression is an absolute expression or symbol that resolves to an absolute.<br />

Based operands are typically used to access structures. The base register points to the<br />

start of the structure, and items in the structure are addressed by an appropriate<br />

expression.<br />

The following examples illustrate based operands:<br />

mov 2(bp), #1000<br />

movb ax, TOP (bx)<br />

neg -4 (bp)<br />

mov ax, (bx) (bp)<br />

Indexed Operands<br />

Indexed operands are bytes or words in memory with addresses computed by adding a<br />

constant and one of the index registers di or si. The operands have the forms<br />

expression (di)<br />

expression (si)<br />

where expression is an absolute expression or symbol that resolves to an absolute.<br />

Indexed operands are often used to access elements in an array. expression points to the<br />

start of the array. The index register is given the index value of the elem ent to be<br />

accessed. Since all array elements are the same length, simple arithmetic on the index<br />

register will select any element.<br />

The following examples illustrate indexed operands:<br />

movb ax,Darray(di)<br />

addb 4096(si), * 1<br />

7-2 1

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

Saved successfully!

Ooh no, something went wrong!