Turbo C

Mike Percy grimlok at hubcap.UUCP
Sat Jul 23 00:04:16 AEST 1988


>From article <4244 at rpp386.UUCP>, by jfh at rpp386.UUCP (John F. Haugh II):
> In article <16577 at brl-adm.ARPA> C08922DB%WUVMD.BITNET at cunyvm.cuny.edu writes:
>>I am interested in understanding the structure of the function type
>>"interrupt" in Turbo C. Basically, what is special about this function
>>definition, and what approaches can be used in other compilers to simulate
>>this feature? Optimum-C is what I'm using.

Well, how about this (file = int.c)

void interrupt test() 
{
}

then I do a tcc -S on it and get

	name	int
int_text	segment byte public 'code'
dgroup	group	_data,_bss
	assume	cs:int_text,ds:dgroup
int_text	ends
_data	segment	word public 'data'
_d@	label	byte
_data	ends
_bss	segment	word public 'bss'
_b@	label	byte
_bss	ends
int_text	segment byte public 'code'
; Line 2
_test	proc	far
	push	ax
	push	bx
	push	cx
	push	dx
	push	es
	push	ds
	push	si
	push	di
	push	bp
	mov	bp,dgroup
	mov	ds,bp
; Line 3
@1:
	pop	bp
	pop	di
	pop	si
	pop	ds
	pop	es
	pop	dx
	pop	cx
	pop	bx
	pop	ax
	iret
_test	endp
int_text	ends
_data	segment word public 'data'
_s@	label 	byte
_data	ends
int_text
	public	_test
int_text	ends
	end

Oh yeah, that was with all other options default (small MM, etc.)



More information about the Comp.lang.c mailing list