assemblyx86-16bootloaderosdevvga

Using 16 bit mode to print a letter WITHOUT bios routines


I realized that in protected mode, one could use memory mapped I/O to print letters by modifying the memory location 0xb8000 and so forth... Can we do this in 16 bit real mode? (Using segmentation to access the location and then modifying it)

This is my assembly code...

[bits 16]
mov ax,0xb800
mov ds,ax    #This is the segment register that should hopefully give me 0xb8000
mov byte[ds:0x0000],'X'
mov byte[ds:0x0001],0x0f

times 510-($ -$$) db 0
dw 0xaa55

This is not working btw..

[edit] Turns out I needed jmp $ at the end to prevent any random code execution and the code works as expected


Solution

  • Turns out I just needed the jmp $ at the end to prevent any random code execution.. The code works as expected