【发布时间】:2012-02-17 20:09:49
【问题描述】:
好的,这是我的代码..
mov ah,08h
mov dl,80h ;have Tried for 81h,82h....
int 13h
mov ah,0Eh
int 10h ; printing the value in al.
int 10h 在屏幕上打印 ascii 字符
开机后 结果始终是包括 80h、81h、82h 在内的所有内容的“笑脸 ascii 字符”。 输出屏幕在这里http://postimage.org/image/5twm1ml5j/ ah=0 为空
在尝试之前,我已将硬盘、USB 连接到我的笔记本电脑...
我做错了什么??
使用 qemu pc 模拟器和 nasm
这是我的全部代码。
BITS 16
start:
mov ax, 1984 ; Set up 4K stack space after this bootloader
add ax, 288 ; (4096 + 512) / 16 bytes per paragraph
mov ss, ax
mov sp, 4096
mov ax, 1984 ; Set data segment to where we're loaded
mov ds, ax
mov ah,08h
mov dl,80h
int 13h
mov ah,0Eh
int 10h
times 510-($-$$) db 0 ; Pad remainder of boot sector with 0s
dw 0xAA55 ; The standard PC boot signature
【问题讨论】:
-
这是我大约 20 年前编写的有效引导加载程序代码:gist.github.com/546634
标签: assembly operating-system nasm bootloader x86-16