Skip to content

Instantly share code, notes, and snippets.

@pinglunliao
Created January 15, 2016 09:34
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save pinglunliao/28006856afc3c4c58b31 to your computer and use it in GitHub Desktop.
Save pinglunliao/28006856afc3c4c58b31 to your computer and use it in GitHub Desktop.
.text
.globl start
.code16
start:
movb $0xE, %ah # write character in text mode for int 10h
movb $'H', %al # write 'H', 'o', 'l', 'a', 'n', ' ', 'w', 'o', 'r', 'l', 'd'
int $0x10
movb $'o', %al
int $0x10
movb $'l', %al
int $0x10
movb $'a', %al
int $0x10
movb $'n', %al
int $0x10
movb $' ', %al
int $0x10
movb $'w', %al
int $0x10
movb $'o', %al
int $0x10
movb $'r', %al
int $0x10
movb $'l', %al
int $0x10
movb $'d', %al
int $0x10
ret
# Fill NOP instruction (opcde = 0x90) till base offset 0x1FE.
.org 0x1FE, 0x90
# This indicates boot disk
boot_flag: .word 0xAA55
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment