Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- bits 16
- org 0x7c00
- jmp 0:main
- main:
- cli
- xor ax, ax
- mov ds, ax
- mov es, ax
- mov ss, ax
- ; Found this online, clutching at straws now
- mov ax, 07C0h ; Set 'ax' equal to the location of this bootloader divided by 16
- add ax, 20h ; Skip over the size of the bootloader divided by 16
- mov ss, ax ; Set 'ss' to this location (the beginning of our stack region)
- mov sp, 4096 ; Set 'ss:sp' to the top of our 4K stack
- ;sti
- ; Example bios call
- mov ax, 0x1112
- int 0x10
- mov eax, cr0
- or eax, 1
- mov cr0, eax
- times 510 - ($-$$) db 0
- dw 0xAA55
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement