[comp.unix.xenix] assembly system calls

ivar@acc.uu.no (Ivar Hosteng) (09/03/89)

I am experimenting with small programs in assembly and is trying to get them
as small as possible. Therefore I need the numbers for the system calls (the
value to put in the eax register before I call the kernel). If anybody knows
how to make a far call in masm I would be glad to be told how to do this. 
I have tried to put a segment at 0x7 and make a far call to a label in that 
segment but masm refused to assemble it. The solution I have used is to 
hardcode the far call with db statements using this macro:

system	MACRO		; macro to trap into kernel in xenix 386
	push 0		; dummy return address
	db	09ah	; opcode for far call
	dd	0	; offset
	dw 	7	; segment
	sub	esp,4	; clean up the stack
	ENDM

This looks awfully dirty so I wonder if it is a cleaner way to do this without
linking in the c libraries.

And while I am at it, why isn't SCO giving the source to the startup code
away with the development kit? You get it with Microsoft's C compiler under
MSDOS and OS/2.


-- 
Ivar E. Hosteng,	Advanced Computer Consultans, Oslo, Norway
Internet:		ivar@acc.uu.no
UUCP:			...!{uunet,mcvax,ifi}!acc.uu.no!ivar
'Just what do you think you are doing Dave?'	-HAL9000