# gcc -nostdlib -nostdinc -Wl,--oformat,binary,-Ttext,0x100 a.s
# Instruction length test
	.code16
	mov	$st, %di
lp:	mov	$1, %ah
	int	$0x21
	sub	$'0', %al
	jb	done
	call	cv
	mov	$4, %cl
	shl	%cl, %al
	push	%ax
	mov	$1, %ah
	int	$0x21
	pop	%bx
	sub	$'0', %al
	jb	done
	call	cv
	or	%bl, %al
	cld
	stosb
	jmp	lp
done:	mov	%di, ed
	push	%es
	mov	$0x3501, %ax
	int	$0x21
	mov	%bx, orig
	mov	%es, orig+2
	pop	%es
	mov	$int1, %dx
	mov	$0x2501, %ax
	int	$0x21
	cli
	pushf
	pop	%ax
	or	$1, %ah
	push	%ax
	push	%cs
	mov	$st, %ax
	mov	%ax, to
	push	%ax
	iret
cv:	test	$0x10, %al
	je	1f
	sub	$7, %al
1:	and	$0xf, %al
	ret
int1:	push	%bp
	mov	%sp, %bp
	push	%ax
	push	%bx
	push	%cx
	push	%dx
	mov	%cs, %ax
	cmp	4(%bp), %ax
	jne	quit
	mov	2(%bp), %dx
	push	%dx
	sub	%cs:to, %dx
	add	$'0', %dl
	mov	$2, %ah
	int	$0x21
	pop	%ax
	cmp	%ax, %cs:ed
	jbe	quit
	mov	%ax, %cs:to
	pop	%dx
	pop	%cx
	pop	%bx
	pop	%ax
	pop	%bp
	iret
quit:	lds	%cs:orig, %dx
	mov	$0x2501, %ax
	int	$0x21
	int	$0x20
ed:	.space	2
orig:	.space	4
to:	.space	2
st:
