There are some issues:
There is no such instruction as sdl
.
To copy data, you should use rep movsw
, not repnz movsw
.
You need to set cx
before rep movsw
.
You need to define the colors of each character too, in every other byte of video memory, either in the data to be copied with rep movsw
, or inside copy loop. The code below illustrates both options:
Edit: added code.
[bits 16]
[org 0x7c00]
mov ax,3
int 10h
push word 0xb800
pop es
push cs ; just in case, for bootloader code,
pop ds ; needed for movsb
xor di,di
mov si,msg
mov cx,msg_length_in_bytes
one_color_copy_to_vram_loop:
movsb
mov al,0x0f
stosb
loop one_color_copy_to_vram_loop
mov si,multicolor_msg
mov cx,multicolor_msg_length
rep movsw
jmp $
msg db 'Hello'
msg_length_in_bytes equ $-msg
multicolor_msg db ' ',0
db 'H',1
db 'e',2
db 'l',3
db 'l',4
db 'o',5
db ' ',0
db 'w',6
db 'i',7
db 't',8
db 'h',9
db ' ',0
db 'c',10
db 'o',11
db 'l',12
db 'o',13
db 'r',14
db '!',15
multicolor_msg_length equ ($-multicolor_msg)/2
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…