Registers and there usage while designing code

Asked By 0 points N/A Posted on -

Hi! I was studying REGISTERS in ASSEMBLY language. Can anybody help me by guiding me on how many kinds of registers there are in assembly language? And which register is used for what purpose? I am also confused about why the AX register is always used for getting data from user and  why the DX register is used for displaying the content inside. Then for what purpose are the BX and CX registers used?

Best Answer by wsaenot2
Best Answer
Best Answer
Answered By 0 points N/A #85949

Registers and there usage while designing code


Well, in CPU registers are used for temporary storage of data.  This data could be one or two bytes large.  That being said, each register has its own purpose. You could force a register to function outside of its purpose in theory, but it is not recommended as each register is actually optimized to perform its function best.  

Assembly language by itself, does not specify the number of registers; instead, it is the specification of the microchip you are programming for that will specify the number of registers.

But do not fear as most chips still have the few standard registers. Taking reference from the 8086/286 chipset, the standard registers and their functions are listed below:

  • Register AX – accumulator ( used for doing actual data operations)
  • Register BX – base addressing register ( used when doing address referencing of data)
  • Register CX – use for counter operations
  • Register DX – use as pointers to data in I/O operations.

I hope this makes things clearer for you.

Answered By 0 points N/A #85951

Registers and there usage while designing code


There are many kinds of registers used for one processor, but it may be different from one processor to another. I mean that they  may work different in another as iAPX 8088 structure is different from 8085, although the names of the registers are the same.The registers AX, BX, CX, and DX are general purpose registers in iAPX88 Intel architecture.Their details are as follows:

  • Index Registers (SI and DI)
  • Instruction Pointer (IP)
  • Stack Pointer (SP)
  • Base Pointer (BP)

They also have their own memory types as some are of 32 bit while some are of 16 bit registers used for the operation of division, subtraction, multiplication and addition. There may be some other uses as well as programming requirements.

Login/Register to Answer

Related Questions