I would like to make a simple bootloader, that writes all the background colors to next lines on the screen.
The problem is, that it only changes the color of the first line to black and the second line to blue, while it should display all 16 colors. I think, that there is something wrong with loop1:, but I don't know what.
Useful informations:
- I am writing directly to the text video memory, starting from address 0xb8000, using method described in this forum post.
- I am using flat assembler 1.73.27 for Windows (fasm assembler).
- I am testing my program on real computer (booting from usb), not an emulator.
- I am not including any photos, because of this post.
My code (fasm assembly):
format binary
use16
org 0x7c00
mov ax,0xb800
mov es,ax
mov bx,0
mov al,0
mov ah,0x0f
mov cx,160
loop1:
call procedure1
add ax,0x1000
add cx,160
cmp ah,0xff
jl loop1
call procedure1
mov cx,4000
mov ah,0x0f
call procedure1
jmp $
procedure1:
mov word [es:bx],ax
add bx,2
cmp bx,cx
jl procedure1
ret
times 510-($-$$) db 0
dw 0xaa55