os_kernel_lab/related_info/lab1/toybootloader/toy.S

31 lines
1.3 KiB
ArmAsm
Raw Normal View History

.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 /* BIOSint0x100x13 */
ret
2015-03-13 22:08:13 +08:00
.org 0x1fe, 0x90 /* 0x1fe=510ret510/0x90 */
.word 0xaa55 /* 合法的主引导扇区标识 */