PageRenderTime 283ms CodeModel.GetById 141ms app.highlight 2ms RepoModel.GetById 139ms app.codeStats 0ms

/asm/boot/gas/boot.S

http://github.com/dennis-gemini/tests
Assembly | 69 lines | 61 code | 8 blank | 0 comment | 0 complexity | fc4f000bad32506e3ac28397d23e96ca MD5 | raw file
 1.code16
 2.text
 3	jmp start
 4	nop
 5oem_name:		.ascii "-DENNIS-"
 6byte_per_sector:	.2byte 512
 7sector_per_cluster:	.byte  1
 8reserved_sector_count:	.2byte 1
 9num_of_fat:		.byte  2
10root_entry_count:	.2byte 224
11total_sector_16:	.2byte 2880
12media:			.byte  0xf0
13fat_size_16:		.2byte 9
14sector_per_track:	.2byte 18
15number_of_heads:	.2byte 2
16hidden_sector:		.4byte 0
17total_sector_32:	.4byte 0
18drive_number:		.byte  0
19reserved1:		.byte  0
20boot_signature:		.byte  0x29
21volume_id:		.4byte 0
22volume_label:		.ascii "BootableDsk"
23file_system_type:	.ascii "FAT12   "
24
25start:
26	mov  %cs, %ax
27	mov  %ax, %ds
28	mov  %ax, %es
29
30	mov $booting, %ax
31	mov $booting_len, %cx
32	mov $0007, %bx
33	mov $0000, %dx
34	call print
35
36	mov $0xb800, %ax
37	mov %ax, %es
38	movw %es:((80*12 + 40) * 2), %ax
39	movb $0x71, %ah
40	inc %al
41	movw %ax, %es:((80*12 + 40) * 2)
42
43halt:
44	cli
45	hlt
46	jmp halt
47//	mov $0xf000, %ax
48//	mov %ax, %es
49//	xor %bx, %bx
50//	ljmp $0xffff, $0
51
52print:
53	//%ax: str
54	//%cx: len
55	//%bh: page
56	//%bl: color
57	//%dh: y
58	//%dl: x
59	mov %ax, %bp
60	mov $0x1301, %ax
61	int $0x10
62	ret
63
64booting:	.ascii	"Booting..."
65.set booting_len, (. - booting)
66
67.org	510
68.word	0xaa55
69