-
Notifications
You must be signed in to change notification settings - Fork 1
/
bootloader.asm
67 lines (52 loc) · 1.08 KB
/
bootloader.asm
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
BITS 16
org 0x7c00
; Format -> Binary file
; Base Address: 0000h Range: 0000h - 0200h Loaded length: 0200h -> 512 bytes
; the way that the actual bootloader code organisation of is a total mess, so i had to fix it
; and way optimize it
segments:
push 0x0A000
pop es
xor ax, ax
xor di, di
mov ax, 13h
int 10h
; print the pixels
x1:
mov ah, 0x0c
inc al ; color
xor bh, bh ; page
inc cx ; x
int 10h
cmp cx, 0xFFFF
je keyboard
jmp x1
keyboard:
mov ax, 0
int 16h
mov ah, 0
mov al, 3
int 10h
mov si, msg
print:
push ax
cld
next:
mov al,[si]
cmp al,0
je done
call printchar
inc si
jmp next
done:
mov ax, 0
int 16h
; ineficient way
jmp segments
printchar:
mov ah,0x0e
int 0x10
ret
msg db "AiVDsDOsA AiVDsDOsA AiVDsDOsA AiVDsDOsA AiVDsDOsA AiVDsDOsA AiVDsDOsA AiVDsDOsA AiVDsDOsA AiVDsDOsA AiVDsDOsA AiVDsDOsA AiVDsDOsA AiVDsDOsA AiVDsDOsA AiVDsDOsA AiVDsDOsA",0
times 510 - ($-$$) db 0
dw 0xaa55