	.MODEL tiny, pascal, os_dos
	.486
	.CODE


hi	PROC NEAR, a:WORD
				; Line 4, Column 6

	mov ax , [ a ] 
	mov al , ah 
	xor ah , ah 
	
_Exit:	ret
hi	ENDP

lo	PROC NEAR, a:WORD
				; Line 12, Column 6

	mov ax , [ a ] 
	xor ah , ah 
	
_Exit:	ret
lo	ENDP

putchar	PROC NEAR, a:BYTE
				; Line 19, Column 6

	mov ah , 2 
	mov dl , [ a ] 
	int 33 
	
_Exit:	ret
putchar	ENDP
	PUBLIC putchar

putstr	PROC NEAR, a:WORD
				; Line 27, Column 8
_Next1:
	mov	ax, [a]
	mov	bx, ax
	mov	ax, [bx]
	push	ax
	call	lo
	push	ax
	mov	ax, 0
	pop	bx
	cmp	ax, bx
	setc	al
	xor	ah, ah
	cmp	ax, 0
	jz	_WEnd1
				; Line 28, Column 12
	mov	ax, [a]
	mov	bx, ax
	mov	ax, [bx]
	push	ax
	call	putchar
				; Line 29, Column 6
	mov	ax, 1
	add	[a], ax
	mov	ax, [a]
	jmp	_Next1
_WEnd1:
_Exit:	ret
putstr	ENDP
	PUBLIC putstr

putcrlf	PROC NEAR
				; Line 34, Column 10
	mov	ax, 13
	push	ax
	call	putchar
				; Line 35, Column 10
	mov	ax, 10
	push	ax
	call	putchar
_Exit:	ret
putcrlf	ENDP
	PUBLIC putcrlf

puthex	PROC NEAR, a:WORD
	LOCAL i:BYTE

				; Line 41, Column 5
	mov	ax, [a]
	push	ax
	mov	ax, 0
	pop	bx
	cmp	ax, bx
	setc	al
	xor	ah, ah
	cmp	ax, 0
	jz	_Else1
				; Line 42, Column 6
	mov	ax, [a]
	push	ax
	mov	ax, 16
	pop	bx
	xchg	ax, bx
	cwd
	idiv	bx
	mov	ax, dx
	mov	[i], al
				; Line 43, Column 7
	movzx	ax, byte ptr [i]
	push	ax
	mov	ax, 10
	pop	bx
	cmp	bx, ax
	setc	al
	xor	ah, ah
	cmp	ax, 0
	jz	_Else2
				; Line 44, Column 8
	mov	ax, 48
	add	[i], al
	movzx	ax, [i]
	jmp	_EndIf2
_Else2:				; Line 46, Column 8
	mov	ax, 65
	push	ax
	mov	ax, 10
	pop	bx
	xchg	ax, bx
	sub	ax, bx
	add	[i], al
	movzx	ax, [i]
_EndIf2:
				; Line 48, Column 11
	mov	ax, [a]
	push	ax
	mov	ax, 16
	pop	bx
	xchg	ax, bx
	cwd
	idiv	bx
	push	ax
	call	puthex
				; Line 49, Column 12
	movzx	ax, byte ptr [i]
	push	ax
	call	putchar
_Else1:
_EndIf1:
_Exit:	ret
puthex	ENDP
	PUBLIC puthex

putword	PROC NEAR, a:WORD
				; Line 54, Column 5
	mov	ax, [a]
	push	ax
	mov	ax, 0
	pop	bx
	cmp	ax, bx
	setc	al
	xor	ah, ah
	cmp	ax, 0
	jz	_Else3
				; Line 55, Column 12
	mov	ax, [a]
	push	ax
	mov	ax, 10
	pop	bx
	xchg	ax, bx
	cwd
	idiv	bx
	push	ax
	call	putword
				; Line 56, Column 12
	mov	ax, 48
	push	ax
	mov	ax, [a]
	push	ax
	mov	ax, 10
	pop	bx
	xchg	ax, bx
	cwd
	idiv	bx
	mov	ax, dx
	pop	bx
	add	ax, bx
	push	ax
	call	putchar
_Else3:
_EndIf3:
_Exit:	ret
putword	ENDP
	PUBLIC putword

putint	PROC NEAR, a:WORD
				; Line 61, Column 5
	mov	ax, [a]
	push	ax
	mov	ax, 0
	pop	bx
	cmp	ax, bx
	setz	al
	xor	ah, ah
	cmp	ax, 0
	jz	_Else4
				; Line 62, Column 12
	mov	ax, 48
	push	ax
	call	putchar
				; Line 63, Column 8
	jmp	_Exit
	jmp	_EndIf4
_Else4:	mov	ax, [a]
	push	ax
	mov	ax, 32767
	pop	bx
	cmp	ax, bx
	setc	al
	xor	ah, ah
	cmp	ax, 0
	jz	_Else5
				; Line 65, Column 12
	mov	ax, 45
	push	ax
	call	putchar
				; Line 66, Column 6
	mov	ax, [a]
	neg	ax
	mov	[a], ax
_Else5:
_EndIf4:
				; Line 68, Column 10
	mov	ax, [a]
	push	ax
	call	putword
_Exit:	ret
putint	ENDP
	PUBLIC putint

halt	PROC NEAR, a:BYTE
				; Line 72, Column 6

	mov ah , 76 
	mov al , [ a ] 
	int 33 
	
_Exit:	ret
halt	ENDP
	PUBLIC halt

strlen	PROC NEAR, a:WORD
	LOCAL i:WORD

				; Line 82, Column 4
	mov	ax, 0
	mov	[i], ax
				; Line 83, Column 8
_Next2:
	mov	ax, [a]
	push	ax
	mov	ax, [i]
	pop	bx
	add	ax, bx
	mov	bx, ax
	mov	ax, [bx]
	push	ax
	call	lo
	push	ax
	mov	ax, 0
	pop	bx
	cmp	ax, bx
	setc	al
	xor	ah, ah
	cmp	ax, 0
	jz	_WEnd2
				; Line 84, Column 6
	mov	ax, 1
	add	[i], ax
	mov	ax, [i]
	jmp	_Next2
_WEnd2:
				; Line 86, Column 6
	mov	ax, [i]
	jmp	_Exit
_Exit:	ret
strlen	ENDP
	PUBLIC strlen

getchar	PROC NEAR
				; Line 90, Column 6

	mov ah , 1 
	int 33 
	xor ah , ah 
	
_Exit:	ret
getchar	ENDP
	PUBLIC getchar

getch	PROC NEAR
				; Line 98, Column 6

	mov ah , 8 
	int 33 
	xor ah , ah 
	
_Exit:	ret
getch	ENDP
	PUBLIC getch

getstr	PROC NEAR, adr:WORD, len:WORD
	LOCAL count:WORD

	LOCAL s:BYTE

				; Line 109, Column 5
	mov	ax, [len]
	push	ax
	mov	ax, 0
	pop	bx
	cmp	ax, bx
	setz	al
	xor	ah, ah
	cmp	ax, 0
	jz	_Else6
				; Line 110, Column 8
	mov	ax, [adr]
	push	ax
	call	strlen
	mov	[len], ax
_Else6:
_EndIf6:
				; Line 112, Column 8
	mov	ax, 1
	mov	[count], ax
				; Line 113, Column 4
	mov	ax, 0
	mov	[s], al
				; Line 114, Column 8
_Next3:
	movzx	ax, byte ptr [s]
	push	ax
	mov	ax, 13
	pop	bx
	cmp	ax, bx
	setnz	al
	xor	ah, ah
	push	ax
	mov	ax, [count]
	push	ax
	mov	ax, [len]
	pop	bx
	cmp	bx, ax
	setc	al
	xor	ah, ah
	pop	bx
	and	ax, bx
	setnz	al
	xor	ah, ah
	cmp	ax, 0
	jz	_WEnd3
				; Line 115, Column 6
	call	getchar
	mov	[s], al
				; Line 116, Column 7
	movzx	ax, byte ptr [s]
	push	ax
	mov	ax, 13
	pop	bx
	cmp	ax, bx
	setnz	al
	xor	ah, ah
	cmp	ax, 0
	jz	_Else7
				; Line 117, Column 10
	mov	bx, [adr]
	push	bx
	movzx	ax, byte ptr [s]
	pop	bx
	mov	[bx], ax
				; Line 118, Column 12
	mov	ax, 1
	add	[count], ax
	mov	ax, [count]
				; Line 119, Column 10
	mov	ax, 1
	add	[adr], ax
	mov	ax, [adr]
_Else7:
_EndIf7:
	jmp	_Next3
_WEnd3:
_Exit:	ret
getstr	ENDP
	PUBLIC getstr

	INCLUDE var.asm

	END
