-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathbootloader.asm
More file actions
180 lines (148 loc) · 6.64 KB
/
Copy pathbootloader.asm
File metadata and controls
180 lines (148 loc) · 6.64 KB
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
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
xor ax, ax
mov ds, ax
mov es, ax
mov ss, ax
;------------------------------------------------------------------
;Gerar o modo de vídeo
;No Mode Text Res Size Box Res Pixel Colors No. Paginas Buffer Addr System Adapter
;13h 40x25 8x8 320x200 256/256K 1 A000 VGA,MCGA
mov al, 0x13
int 0x10
;Finalizado
;Chamar Fundo Branco
call DesenhaFundoBranco
;Agora que o fundo está branco, precisa escrever a frase
call BotaFrase
;Desenha
;call Desenha
;Acabou
jmp $
;------------------------------------------------------------------
DesenhaFundoBranco:
push bp
mov bp, sp
pusha
;Int 10h, 0Ch Write Pixel
;
; Writes a pixel dot of a specified color at a specified screen
; coordinate.
;
; Entry AH = 0Ch
; AL = Pixel color
; CX = Horizontal position of pixel
; DX = Vertical position of pixel
; BH = Display page number (graphics modes with more
; than 1 page)
;
; Return Nothing
;No Mode Text Res Size Box Res Pixel Colors No. Paginas Buffer Addr System Adapter
;13h 40x25 8x8 320x200 256/256K 1 A000 VGA,MCGA
xor cx, cx; posição horizontal -> 0
mov dx, 0x1e ;posição vertical -> 30
mov ah, 0x0c
mov al, 0x0f
recomeca:
int 0x10
inc cx
cmp cx, 0x140 ;320 em decimal
je zeraHorizontal
jmp recomeca
fim:
popa
mov sp, bp
pop bp
ret
;------------------------------------------------------------------
zeraHorizontal:
xor cx, cx
inc dx
cmp dx, 0xc8 ;200 em decimal
je fim
jmp recomeca
;------------------------------------------------------------------
BotaFrase:
push bp
mov bp, sp
pusha
;Int 10h, 13h Write Character String
;Writes a string of characters with specified attributes to any
; display page.
; Entry AH = 13h
; AL = Subservice (0-3)
; BH = Display page number
; BL = Attribute (Subservices 0 and 1)
; CX = Length of string
; DH = Row position where string is to be written
; DL = Column position where string is to be written
; ES:BP = Pointer to string to write
; Return Nothing
;The service has four subservices, as follows:
; AL=00h: Assign all characters the attribute in BL; do not
; update cursor
; AL=01h: Assign all characters the attribute in BL; update
; cursor
; AL=02h: Use attributes in string; do not update cursor
; AL=03h: Use attributes in string; update cursor
mov ah, 0x13
mov al, 0x01
xor bx, bx
mov bl, 0x0f
mov cx, 0x0f
mov dh, 0x1c
mov dl, 0x04
mov bp, mensagem
add bp, 0x7c00
int 0x10
popa
mov sp, bp
pop bp
ret
;------------------------------------------------------------------
dados: db 52,91,61,47,69,52,91,62,44,71,53,90,62,43,72,54,88,64,41,73
db 56,86,64,39,75,55,86,65,38,76,55,86,66,36,77,56,85,66,35,78
db 56,85,32,9,2,4,20,32,80,57,83,29,21,18,31,81,58,82,26,25,17,30,82
db 58,82,24,28,16,28,84,58,81,23,32,14,27,85,59,80,21,35,13,26,86,59,80,20
db 30,1,5,14,23,88,60,79,5,1,14,35,1,3,11,22,89,61,77,5,3,11,23,1,18,10,21,90
db 63,75,5,3,10,23,2,2,3,9,2,4,8,19,92,64,74,4,4,9,17,2,3,8,5,2,4,1,5,7,18,93
db 64,74,5,4,7,17,4,1,9,4,3,4,2,5,6,17,94,66,72,4,5,6,18,21,12,5,16,95,66,72,4,5
db 5,19,22,12,4,15,96,67,71,4,6,3,18,19,2,2,15,2,14,97,68,70,3,30,17,1,3,16,1,13
db 98,70,68,4,26,1,3,20,1,1,27,99,71,67,4,26,26,26,100,72,66,4,28,2,3,20,2,2,19
db 102,74,64,4,24,1,3,2,4,4,2,17,18,103,76,62,3,24,6,2,26,17,104,79,59,3,24,33,1,1
db 3,1,11,105,81,57,3,21,1,2,37,12,106,84,55,2,22,12,2,5,2,18,12,106,87,52,2,23,11
db 2,25,13,105,91,49,1,23,38,13,105,93,47,1,22,39,2,6,6,104,96,44,1,22,38,3,8,5,103
db 102,39,1,19,4,1,35,4,4,1,4,4,102,102,59,41,3,10,5,100,102,9,2,46,43,3,11,5,99
db 116,43,43,3,12,4,99,123,15,1,20,44,2,12,4,99,126,7,4,1,2,19,44,2,13,3,99,129,4,8
db 16,46,3,14,2,98,141,15,47,4,12,4,97,143,12,15,1,31,5,13,3,97,143,11,13,1,34,5,14
db 3,96,142,11,13,2,28,2,3,6,14,3,96,142,11,12,1,31,3,1,6,14,4,95,144,9,4,2,6,1,32,2
db 2,5,14,4,95,144,8,2,2,2,3,26,3,8,1,3,3,16,5,94,144,8,2,2,1,5,2,1,7,2,1,2,5,2,2,5,1,1
db 4,1,4,3,17,4,94,144,9,1,2,1,9,2,9,4,4,1,7,2,3,3,3,18,4,94,144,6,2,1,1,13,1,5,1,4,2,17
db 3,2,20,3,95,144,5,7,40,25,4,95,144,5,7,38,27,5,94,142,7,8,36,29,4,94,140,9,8
db 36,29,4,94,140,8,10,21,3,1,2,5,32,4,94,140,7,12,1,2,15,9,1,35,4,94,140,7,16,14,45
db 4,94,141,5,18,12,46,4,94,141,5,21,9,46,4,94,141,5,26,4,47,4,93,141,4,30,1,47
db 4,93,141,4,78,4,93,141,4,78,4,93,142,3,24,1,53,4,93,141,4,23,2,53,4,93,140
db 5,23,5,50,4,93,140,5,23,7,48,4,93,140,5,23,8,48,3,93,140,6,22,8,48,3,93,140,6
db 23,8,47,4,92,140,6,23,9,46,4,92,141,5,23,10,46,3,92,140,6,24,9,46,3,92,140,7
db 25,8,45,3,92,140,8,25,6,46,3,92,140,8,26,6,45,3,92,140,7,4,2,19,1,2,5,45,5,90
db 140,6,3,3,20,2,2,4,45,5,90,140,6,2,3,22,7,46,4,90,140,5,2,6,20,7,46,5,89,140,5,2
db 3,2,2,19,7,17,2,2,1,7,2,14,6,89,140,10,3,2,18,3,1,3,14,2,4,2,2,1,17,11,2,1,84,140,5
db 1,3,2,1,20,3,2,3,8,1,11,6,16,14,84,140,5,1,3,2,2,2,1,15,4,2,5,4,3,11,4,21,11,84,140
db 5,1,3,4,13,2,1,2,4,2,12,36,11,84,140,5,1,3,2,2,1,12,2,1,8,5,43,11,84,140,1,2,6,6,13
db 9,4,45,10,84,140,1,3,1,1,3,5,3,1,6,62,9,85,140,3,4,3,4,3,69,9,85,141,5,1,3,4,3
db 10,2,57,9,85,140,7,8,2,2,6,61,9,85,140,7,3,13,63,9,85,140,7,2,8,68,10,85,136
db 11,4,5,68,11,85,137,11,2,7,66,12,85,139,9,2,8,9,3,1,1,49,14,85,141,7,2,12,3,7,48
db 15,85,141,7,1,13,3,7,47,16,85,141,29,48,17,85,141,23,53,18,85,141,22,53,19,85
db 141,21,53,21,84,141,22,51,22,84,141,22,1,2,47,23,84,141,19,1,1,51,23,84,142
db 19,50,25,84,142,19,49,26,84,142,18,48,28,84,143,17,47,29,84,143,18,44,31,84
db 143,20,40,33,84,143,21,37,35,84,143,24,32,37,84,142,27,27,40,84,142,30,21,42,85
db 143,32,14,46,85,143,92,85,144,91,85,144,91,85,145,89,86,145,89,86
db 146,88,86,146,66,3,19,86,146,64,6,17,87,147,61,8,17,87,148,59,3,3,3,17,87
db 148,13,2,42,5,3,2,17,88,149,12,4,39,2,2,2,2,3,16,89,150,12,6,30,2,3,4,1,5,17,90
db 151,11,2,4,4,25,3,2,5,1,4,16,92,152,11,2,4,7,16,15,1,2,17,93,154,10,2,4,5,2,7,5,6,2,6
db 1,3,18,95,155,10,2,4,3,3,10,2,4,4,5,2,3,17,96,157,10,2,2,3,3,2,3,6,1,7,2,3,3,3,15,98
db 158,11,7,1,3,2,13,2,3,3,3,15,99,159,12,6,1,3,3,4,2,3,2,4,2,4,14,101,162,12,3,3,7,3,7,2,4
db 15,102,164,12,2,3,6,3,4,3,4,16,103,166,10,4,3,3,4,2,3,4,16,105,255
;Variáveis
mensagem: db 'Me contrata! =D'
;finalizando
;times (510 - ($ - $$)) db 0x00
dw 0xAA55