Category:8086 Assembly: Difference between revisions

m
Line 39:
 
===Other Registers===
When writing to or reading from consecutive sections of memory, it is helpful to apply an offset from a base value. The Base Pointer register <code>BP</code>, Source Index <code>SI</code>, and Destination Index <code>DI</code> can point to various regions of memory. Many commands that work with these registers can auto-increment or decrement them after each load or store. In addition, they can be optionally offset by a constant, the value stored in <code>BX</code>, or both at the same time. (<code>BX</code> cannot be added to <code>BP</code> in this manner, but it can be added to <code>DI</code>, and <code>SI</code>.) Unlike the data registers, <code>BP</code>,<code>DI</code>, and <code>SI</code> cannot be split in half and worked on separately. Only data registers allow you to work in 8-bit.
 
The syntax for offsetting an index register will vary depending on your assembler. Many assemblers will often accept multiple different ways of writing it, and it comes down to personal preference.
1,489

edits