summaryrefslogtreecommitdiff
path: root/bootblocks/li86.s
blob: 0c391ff252965368d99f58a5bbad79189f82b31e (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
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
!----------------------------------------------------------------------------
!
! This is a skeleton for creating an impure Linux-8086 executable without
! using the linker. The .text and .data areas are correctly positioned.
!
! This file needs to be compiled using the 3 pass mode (-j)
!
!----------------------------------------------------------------------------
.text
org -32
.word	0x0301			! Magic
.word	0x0410			! Btype
.long	0x20			! header length
.long	_etext			! a_text
.long	_edata-_etext		! a_data
.long	0			! a_bss
.long	0			! a_entry
.long	STACK_SIZE		! a_total
.long	0			! a_syms
.data
.blkb	_etext
.even
.text
!----------------------------------------------------------------------------

STACK_SIZE = 0x10000

.data
var:
.word	$1234

.text
	int	$20
	mov	ax,var
	mov	bx,_edata
	push	ax
	ret

!----------------------------------------------------------------------------
! This trailer must be at the end of the file.
.text
_etext:
.data
_edata:
END