aboutsummaryrefslogtreecommitdiffstats
path: root/menu/startup.S16
blob: 6ca7ced0a3a683e7a12d3702558a7cee94bd102a (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
	.code16gcc

	.globl _start
_start:
	/* Make sure stack pointer is normalized */
	movzwl %sp,%esp

	/* Zero .bss */
	movw $__bss_start,%di
	xorl %eax,%eax
	movw $(_end+3),%cx
	subw %di,%cx
	shrw $2,%cx
	cld
	rep ; stosl

	/* Invoke main() */
	calll main

	/* Terminate program (with error code in %al) */
	movb $0x4c,%ah
	int $0x21
	hlt