《操作系统》的实验代码。
25개 이상의 토픽을 선택하실 수 없습니다. Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 
 

30 lines
1.3 KiB

.text
.globl start /* start处开始运行 */
.code16
start:
jmpl $0x0, $code
msg:
.string "Hello world!"
code:
mov %cs,%ax
mov %ax,%ds
mov %ax,%es
mov %ax,%ss
mov $0x400,%sp
call dispstr /* call dispstr函数显示字符串 */
loop0: /* */
jmp loop0
dispstr:
mov $msg ,%ax
mov %ax ,%bp /* es:bp = */
mov $12 ,%cx /* cs = */
mov $0x1301 ,%ax /* ah=0x13 ,al=0x1 */
mov $0x000c ,%bx /* bh=0 0, bl=0xc */
mov $0 ,%dl /* 00*/
int $0x10 /* BIOS提供的int服务0x10的0x13功能 */
ret
.org 0x1fe, 0x90 /* 0x1fe=510ret后的位置开始510/0x90 */
.word 0xaa55 /* */