#include <dos.h>
#include <stdio.h>

static void (interrupt far *old1c)() = 0;
static void interrupt _far int1c();

static int called=0;
static int intflags=0;

main()
{
	_disable();
	old1c = _dos_getvect(0x1c);
	_dos_setvect(0x1c, int1c);
	_enable();
	while (!called)
		;
	_disable();
	_dos_setvect(0x1c, old1c);
	_enable();
	printf("flags=%x\n", intflags);
}

static void interrupt _far
int1c(es, ds, di, si, bp, sp, bx, dx, cx, ax, off, seg, flags)
int es, ds, di, si, bp, sp, bx, dx, cx, ax, off, seg, flags;
{
	called++;
	_asm	pushf
	_asm	pop	ax
	_asm	mov	intflags,ax
}
