[comp.os.minix] NYUMINIX:LIB\HEAD.ASM

jai@lab.ultra.nyu.edu (Benchiao Jai) (02/24/91)

public begtext, begdata, begbss, _data_org, _exit
extrn _main:near, _stackpt:word, endbss:byte

DGROUP	group	_TEXT,_DATA,_BSS

_TEXT	segment byte	public	'CODE'
	assume	cs:_TEXT,ds:DGROUP
begtext:
	jmp short L0
	dw  DGROUP:begdata
	dw  DGROUP:endbss
	dw  5 dup(0)	; kernel uses this area as stack for inital IRET
L0:	mov sp,_stackpt
	call _main
L1:	jmp L1			; this will never be executed
_exit:	jmp _exit		; this will never be executed either
_TEXT	ends

_DATA	segment word	public	'DATA'
begdata label	word
_data_org dw 8 dup (0)		; first 8 words of MM, FS, INIT are for stack
_DATA	ends

_BSS	segment word	public	'BSS'
begbss	label	word
_BSS	ends

	end