【发布时间】:2011-01-19 16:27:09
【问题描述】:
我试图弄乱一些程序集,创建一个操作系统。当此代码加载到引导加载程序中时,假设输出“这是我很酷的新操作系统!Woohoo!ChigginsOS”,但现在它说的是,最后减去了“Chiggins”。我哪里错了?
BITS 16
start:
mov ax, 07C0h
add ax, 288
mov ss, ax
mov sp, 4096
mov ax, 07C0h
mov ds, ax
mov si, text_string
call print_string
mov si, name_string
call print_string
jmp $
text_string db 'This is my cool new OS! Woohoo!',0
name_string db 'ChigginsOS',0
;---------------------------------------------------------------------------------------
exit:
ret
;---------------------------------------------------------------------------------------
print_string:
mov ah, 0Eh
.repeat:
lodsb
cmp al, 0
je .done
int 10h
jmp .repeat
.done:
call exit
;---------------------------------------------------------------------------------------
times 510-($-$$) db 0
dw 0xAA55
【问题讨论】: