Buscar

lunes, 6 de mayo de 2013

Guide Programming - Part 1

Visual Assembler is based on the fundamentals of programming in assembler for 32-bit x86 architecture, but does not include the complete set of instructions and features, although this does not preclude the performance of all such algorithms.

  • Processor registers: a register in a microprocessor is like a scratch pad. It is a volatile memory segment that holds entities temporarily for calculations.

AX: This is a 16 bit register. Is also called as the accumulator. Most operations performed by the microprocessor generally involve the microprocessor store the final result in the accumulator.
BX: The base register. The general convention is to store some 16 bit address in BX. It can also perform computation. That is not an issue.
CX: The counting register. It is used mostly for implementing counters.
DX: The Data register. It is used in I/O instructions as a pointer to data by storing the address of the I/O port.

The registers we have seen till now are 16 bits. However we can split these registers in 2 8-bit registers for our convenience. For example , we can split BX into BL and BH.

SI and DI: Source Index and Destination Index are address registers.

IP: Instruction Pointer Register is a crucially important register which is used to control which instruction the CPU executes. The ip, or program counter, is used to store the memory location of the next instruction to be executed. The CPU checks the program counter to ascertain which instruction to carry out next. It then updates the program counter to point to the next instruction. Thus the program counter will always point to the next instruction to be executed.

No hay comentarios:

Publicar un comentario