Skip to content

Instantly share code, notes, and snippets.

@sei0o
Last active March 9, 2018 23:44
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 sei0o/a67b42bb0e83ca6d8ef4a350a4b11e3b to your computer and use it in GitHub Desktop.
Save sei0o/a67b42bb0e83ca6d8ef4a350a4b11e3b to your computer and use it in GitHub Desktop.
kirakira PBR
$ nasm kirakira_pbr.asm
$ sudo dd if=kirakira_pbr of=/dev/to/your/mbr/usb/partition bs=512 count=1

Use a USB memory which uses MBR (not UEFI).
dd rewrites your USB's PBR (boot loader); don't forget to save backup and play at your own risk!

org 0x7c00
jmp short entry
nop
times 0x3e - ($ - $$) db 0
entry:
mov ax, 0
mov ss, ax
mov sp, 0x7c00
mov ds, ax
mov es, ax
mov ax, 0x0013
int 0x10
mov bl, 0xf
mov si, msg1
call puts
mov bl, 0xe
mov si, msg2
call puts
mov bl, 0xd
mov si, msg3
call puts
mov bl, 0xf
mov si, msg4
call puts
fin:
hlt
jmp fin
puts:
mov al, [si]
inc si
cmp al, 0
je puts_end
mov ah, 0x0e
mov bh, 0
int 0x10
jmp puts
puts_end:
ret
msg1:
db "ore ha ", 0
msg2:
db "kirakira ", 0
msg3:
db "kosen girl", 0
msg4:
db "!!", 0
times 510 - ($ - $$) db 0
db 0x55, 0xaa
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment