assemblyx86nasm

Overcoming the BX-only-indexing restriction


I'm implementing a simple 0-terminated string printing function using BIOS interrupt int 10h.

The procedure is as follows:

The problem is nasm will only let me use bx as an index register. I believe this restriction's purpose isn't to make someone's life more difficult, so that would imply there's something wrong with my implementation. What is is, how can I overcome it?


Solution

  • In 16-bit mode you have to use BX. E.g. see here:

    For 16-bit addressing, the offset value can be in one of the three registers: BX, SI, or DI