Is BX the Base Address Register, and if so why?
Clash Royale CLAN TAG#URR8PPP
up vote
3
down vote
favorite
I've seen a lot of posts on BX. I believe today, it's a "General Purpose Register". I'm confused at why people call it the Base Address Register,
- Why it's called the Base Address register, historically.
- Is any of that still relevant today?
- Is there a convention to reserve it's use for base-addressing?
You can see it being called that here.
intel
add a comment |Â
up vote
3
down vote
favorite
I've seen a lot of posts on BX. I believe today, it's a "General Purpose Register". I'm confused at why people call it the Base Address Register,
- Why it's called the Base Address register, historically.
- Is any of that still relevant today?
- Is there a convention to reserve it's use for base-addressing?
You can see it being called that here.
intel
add a comment |Â
up vote
3
down vote
favorite
up vote
3
down vote
favorite
I've seen a lot of posts on BX. I believe today, it's a "General Purpose Register". I'm confused at why people call it the Base Address Register,
- Why it's called the Base Address register, historically.
- Is any of that still relevant today?
- Is there a convention to reserve it's use for base-addressing?
You can see it being called that here.
intel
I've seen a lot of posts on BX. I believe today, it's a "General Purpose Register". I'm confused at why people call it the Base Address Register,
- Why it's called the Base Address register, historically.
- Is any of that still relevant today?
- Is there a convention to reserve it's use for base-addressing?
You can see it being called that here.
intel
intel
asked 2 hours ago
Evan Carroll
2629
2629
add a comment |Â
add a comment |Â
1 Answer
1
active
oldest
votes
up vote
4
down vote
BX has always been one of the general registers, and it has always been called the base register (see for example The 8086 Primer, page 19). It is the base register because it can be used in various based addressing modes: storing an address in BX, and an offset in SI or DI (the source and destination index registers respectively), allows memory to be accessed at BX + SI or BX + DI (ibid, page 31), or BX + SI + immediate, or even BX + immediate.
BP is similar, and supports identical addressing modes. The difference between BX and BP is that BX defaults to the data segment (DS), whereas BP defaults to the stack segment (SS).
Those addressing modes still exist today, so their use is still relevant, but indexed and indirect addressing are available with any general, pointer or index register starting with 32-bit x86, so while BX and BP are “special†on 16-bit x86, EBX, EBP, RBX and RBP aren’t on 32- or 64-bit x86. There is no convention I’m aware of to specifically reserve the use of BX for base-addressing; if you need to use it for base-addressing, you set it up appropriately and use it. If the calling convention in use mandates that BX is preserved, you need to ensure you take that into account (as caller or callee depending on the convention and the code you’re writing).
add a comment |Â
1 Answer
1
active
oldest
votes
1 Answer
1
active
oldest
votes
active
oldest
votes
active
oldest
votes
up vote
4
down vote
BX has always been one of the general registers, and it has always been called the base register (see for example The 8086 Primer, page 19). It is the base register because it can be used in various based addressing modes: storing an address in BX, and an offset in SI or DI (the source and destination index registers respectively), allows memory to be accessed at BX + SI or BX + DI (ibid, page 31), or BX + SI + immediate, or even BX + immediate.
BP is similar, and supports identical addressing modes. The difference between BX and BP is that BX defaults to the data segment (DS), whereas BP defaults to the stack segment (SS).
Those addressing modes still exist today, so their use is still relevant, but indexed and indirect addressing are available with any general, pointer or index register starting with 32-bit x86, so while BX and BP are “special†on 16-bit x86, EBX, EBP, RBX and RBP aren’t on 32- or 64-bit x86. There is no convention I’m aware of to specifically reserve the use of BX for base-addressing; if you need to use it for base-addressing, you set it up appropriately and use it. If the calling convention in use mandates that BX is preserved, you need to ensure you take that into account (as caller or callee depending on the convention and the code you’re writing).
add a comment |Â
up vote
4
down vote
BX has always been one of the general registers, and it has always been called the base register (see for example The 8086 Primer, page 19). It is the base register because it can be used in various based addressing modes: storing an address in BX, and an offset in SI or DI (the source and destination index registers respectively), allows memory to be accessed at BX + SI or BX + DI (ibid, page 31), or BX + SI + immediate, or even BX + immediate.
BP is similar, and supports identical addressing modes. The difference between BX and BP is that BX defaults to the data segment (DS), whereas BP defaults to the stack segment (SS).
Those addressing modes still exist today, so their use is still relevant, but indexed and indirect addressing are available with any general, pointer or index register starting with 32-bit x86, so while BX and BP are “special†on 16-bit x86, EBX, EBP, RBX and RBP aren’t on 32- or 64-bit x86. There is no convention I’m aware of to specifically reserve the use of BX for base-addressing; if you need to use it for base-addressing, you set it up appropriately and use it. If the calling convention in use mandates that BX is preserved, you need to ensure you take that into account (as caller or callee depending on the convention and the code you’re writing).
add a comment |Â
up vote
4
down vote
up vote
4
down vote
BX has always been one of the general registers, and it has always been called the base register (see for example The 8086 Primer, page 19). It is the base register because it can be used in various based addressing modes: storing an address in BX, and an offset in SI or DI (the source and destination index registers respectively), allows memory to be accessed at BX + SI or BX + DI (ibid, page 31), or BX + SI + immediate, or even BX + immediate.
BP is similar, and supports identical addressing modes. The difference between BX and BP is that BX defaults to the data segment (DS), whereas BP defaults to the stack segment (SS).
Those addressing modes still exist today, so their use is still relevant, but indexed and indirect addressing are available with any general, pointer or index register starting with 32-bit x86, so while BX and BP are “special†on 16-bit x86, EBX, EBP, RBX and RBP aren’t on 32- or 64-bit x86. There is no convention I’m aware of to specifically reserve the use of BX for base-addressing; if you need to use it for base-addressing, you set it up appropriately and use it. If the calling convention in use mandates that BX is preserved, you need to ensure you take that into account (as caller or callee depending on the convention and the code you’re writing).
BX has always been one of the general registers, and it has always been called the base register (see for example The 8086 Primer, page 19). It is the base register because it can be used in various based addressing modes: storing an address in BX, and an offset in SI or DI (the source and destination index registers respectively), allows memory to be accessed at BX + SI or BX + DI (ibid, page 31), or BX + SI + immediate, or even BX + immediate.
BP is similar, and supports identical addressing modes. The difference between BX and BP is that BX defaults to the data segment (DS), whereas BP defaults to the stack segment (SS).
Those addressing modes still exist today, so their use is still relevant, but indexed and indirect addressing are available with any general, pointer or index register starting with 32-bit x86, so while BX and BP are “special†on 16-bit x86, EBX, EBP, RBX and RBP aren’t on 32- or 64-bit x86. There is no convention I’m aware of to specifically reserve the use of BX for base-addressing; if you need to use it for base-addressing, you set it up appropriately and use it. If the calling convention in use mandates that BX is preserved, you need to ensure you take that into account (as caller or callee depending on the convention and the code you’re writing).
answered 2 hours ago
Stephen Kitt
29.8k4121144
29.8k4121144
add a comment |Â
add a comment |Â
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
StackExchange.ready(
function ()
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fretrocomputing.stackexchange.com%2fquestions%2f7627%2fis-bx-the-base-address-register-and-if-so-why%23new-answer', 'question_page');
);
Post as a guest
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Sign up using Google
Sign up using Facebook
Sign up using Email and Password