(This is in addition to Stephen Kitts answer)
Why it's called the Base Address register, historically.
Well, it isn't. If it all, then it would be 'Base Index' (or better Index Base), as it was in original 16 bit addressing the only register that could be added as a 'Base' in all indexed addressing. Indexed with SI
or DI
that is. (*1)
This addressing was symmetric with BP
as Base Pointer. The basic idea was that an array can be pointed at with BX and addressed via SI
or DI
without further ado - or BP when within the stack (*2)
Beside that it's one of the original general purpose two byte registers.
Is any of that still relevant today?
Not really. At least not in 32/64 bit mode. REX
addressing allows the use of any of the 'classic' register as (index) base in 32 Bit mode - except BP
/SP
(*3). In 64 bit mode 12 of the 16 registers can be used the same way (Not BP
/SP
/R12
/R13
(*4)).
Now, having said that, 'Long' mode with 16 bit protected mode code segments comes along. Here classic (16 Bit) encoding is used together with 32/64 bit register size. BX
retains its encoding advantage, as SIB
is not needed. How much this rather forgotten mode is relevant is up for discussion.
Is there a convention to reserve its use for base-addressing?
Not really. Use as needed. After all, this is Assembly - there is no convention you don't want :))
The only issue to keep in mind is preserving it for your caller (unless it's explicitly not done)
You can see it being called that here.
Err ... lets say he's not wrong, but I would recommend looking for better in-detail description to learn about x86 (Check Wiki(books) or OSDEV-Wiki). Or if it is specific about classic (16 Bit) x86 programming, then there is only one book you to read: Steve Morse' 8086 Primer. 32/64 Bit is different anyway and need to be learned without these classic assumptions to be really useful instead of a rucksack of special cases on special cases.
*1 - If you want to assign mnemonic names to the 4 basic two byte registers, it might be
- AX = Accumulator. Used for Arithmetic (or Always the shortest encoding)
- BX = Base. Used as a pointer to data (structures)
- CX = Counter. Used in shift/rotate, string ops and loops.
- DX = Data. Used in arithmetic and I/O.
*2 - Then again, in case of 'standard' programming BP
does hold the stack frame, so an index here is always an index into that frame, unless BP is temporarily moved.
*3 - SP
can also be used with SIB
encoding.
*4 - SP
/R12
again with SIB
encoding.