x86 architecture notes

    real mode

        registers

                     0              15
            ax      | ah     | al    |
            bx      | bh     | bl    |
            cx      | ch     | cl    |
            dx      | dh     | dl    | general-purpose registers

            bp      |        .       | stack frame base pointer
            sp      |        .       | top of stack pointer

            si      |        .       | source index
            di      |        .       | destination index

            ip      |        .       | instruction pointer

            sw      |        .       | status word (flags)

            cs      |        .       | code segment register
            ss      |        .       | stack segment register
            ds      |        .       | data segment register
            es      |        .       | extra segment register

        segment combinations

            cs:ip  code to execute
            ss:sp  top of stack
            ds:si  typically, src string pointer
            es:si  typically, dst string pointer

        memory map

            0x00000 (1k)

                lowmem, real mode interrupt vector table
             
            0x00400 (256k bytes)

                lowmem, bios data

            0x00500 (~30k)

                available ram

            0x07c00 (512 bytes)

                os boot sector

            0x07e00 (480k)

                available ram

            0x80000 (128k)

                extended bios data area

            0xa0000 (64k)

                ega/vga graphics modes

            0xb0000 (32k)

                monochrome text mode

            0xb8000 (32k)

                colour text mode

            0xc0000 (128k)

                rom of video card and/or network cards

            0xe0000 (128k)

                rom of bios

            .

        bda / ebda maps

            See https://wiki.osdev.org/Memory_Map_(x86)