我制作了应该与 vmem 一起使用的驱动程序,但它不起作用。我认为错误是我用来指向内存的寄存器。
有驱动代码:
;;;;;;; Primary Video Driver
PVideo:
.treadbyte: ; in:eax=ID, [0 - 3440]; out:cl=BYTE [0 - 255]
push eax ebx
mov ebx, 0xb8000
imul eax, 2
inc eax
add ebx, eax
mov cl, byte[ebx]
pop eax ebx di
ret
.treadattr: ; in:eax=ID, [0 - 3440]; out:cl=BYTE [0 - 255]
push eax ebx
mov ebx, 0xb8000
imul eax, 2
add ebx, eax
mov cl, byte[ebx]
pop eax ebx
ret
.twritebyte: ; in:eax=ID, [0 - 3440]/dl=BYTE, [0 - 255]; out:none
push eax ebx
mov ebx, 0xb8000
imul eax, 2
inc ax
add ebx, eax
mov byte[ebx], dl
pop eax ebx
ret
.twriteattr: ; in:eax=ID, [0 - 3440]/dl=BYTE, [0 - 255]; out:none
push eax ebx
mov ebx, 0xb8000
imul eax, 2
add ebx, eax
mov byte[ebx], dl
pop eax ebx
ret
.twritezs: ; in:eax=POS, [0 - 3440-len(ZS)]/si=ZS, offset[0 - 32512]/dl=BYTE; out:none
push eax ebx
mov ebx, 0xb8000
;imul eax, 2
;inc eax
add ebx, eax
.l:
lodsb
cmp al, 0x00
je .ret
mov byte[ebx], dl
inc ebx
mov byte[ebx], al
inc ebx
jmp .l
.ret:
pop eax ebx
ret
我正在分析代码,但找不到任何错误。
PS:我只测试了 .twritezs 功能,也许另一个也不起作用。