The difference between `bx` and` bp`?

What is the difference between bx and bp in an assembly? An example is here:

 mov bx, 1h mov bp, 1h 

Do they refer to the same memory? Same thing with ss and sp ?

+7
source share
1 answer

On x86 , the bx and bp registers are completely unrelated. The only thing connected with them is the word base .

  • bx (base index) is a general-purpose register (e.g. ax, cx and dx), usually used as a pointer to data (used for arrays, etc.)
  • bp (base pointer) is usually used to indicate somewhere on the stack (for example, contain the address of the current stack frames)

Again, ss and sp also different.

  • ss (stack segment) is a segment register (e.g. cs, ds and es). It contains the segment used by the stack.
  • sp (stack pointer) points at the top of the stack
+15
source

All Articles