# as -o a.o 20100814-fizzbuzz.s && ld --oformat binary -o a.com a.o
.code16
	xor	%si,%si
	mov	$0x200,%di
	push	%di
	cld
l2:
	inc	%si
	call	l1
	mov	$' ',%al
	stosb
	cmp	$100,%si
	jb	l2
	mov	$'\n'*256+'\r',%ax
	stosw
	mov	$9*256+'$',%ax
	stosb
	pop	%dx
	int	$0x21
	ret
l1:
	mov	%si,%ax
	aam	$15
	jp	l4
	mov	%si,%ax
	aam
	test	%ah,%ah
	je	l6
	call	l3
l3:
	xchg	%ah,%al
l6:
	add	$'0',%al
	stosb
	ret
l4:
	je	l8
	aam	$3
l7:
	mov	$'i'*256+'F',%ax
	je	l5
	.byte	0x81	# 0x81 + call near = sub $imm,%ax
l8:
	call	l7
	mov	$'u'*256+'B',%ax
l5:
	stosw
	mov	$'z'*256+'z',%ax
	stosw
	ret
