real-mode

Near call/jump tables don't always work in a bootloader

◇◆丶佛笑我妖孽 提交于 2019-11-26 11:19:20
问题 General Problem I\'ve been developing a simple bootloader and have stumbled on a problem on some environments where instructions like these don\'t work: mov si, call_tbl ; SI=Call table pointer call [call_tbl] ; Call print_char using near indirect absolute call ; via memory operand call [ds:call_tbl] ; Call print_char using near indirect absolute call ; via memory operand w/segment override call near [si] ; Call print_char using near indirect absolute call ; via register Each one of these

What are the segment and offset in real mode memory addressing?

有些话、适合烂在心里 提交于 2019-11-26 11:14:47
问题 I am reading about memory addressing. I read about segment offset and then about descriptor offset. I know how to calculate the exact addresses in real mode. All this is OK, but I am unable to understand what exactly offset is? Everywhere I read : In real mode, the registers are only 16 bits, so you can only address up to 64k. In order to allow addressing of more memory, addressקד are calculated from segment * 16 + offset. Here I can understand the first line. We have 16 bits, so we can