🥲操作一波
一系列操作
$mkdir OS2022$cd OS2022
$touch mbr.s.code16
.global start
start:
movw %cs, %ax
movw %ax, %ds
movw %ax, %es
movw %ax, %ss
movw $0x7d00, %ax
movw %ax, %sp # setting stack pointer to 0x7d00
pushw $13 # pushing the size to print into stack
pushw $message # pushing the address of message into stack
callw displayStr # calling the display function
loop:
jmp loop
message:
.string "Hello, World!\n\0"
displayStr:
pushw %bp
movw 4(%esp), %ax
movw %ax, %bp
movw 6(%esp), %cx
movw $0x1301, %ax
movw $0x000c, %bx
movw $0x0000, %dx
int $0x10
popw %bp
ret
Last updated