;---------------------------------------------------------------------
code 'bye',bye
	sub ebx,ebx	;Return exit status 0
	mov eax,ebx
	inc eax		;1 = sys_exit
	int 80h
code 'cr',cr
	upsh 10
	call emit
	ret
code 'emit',emit
	push ebx,ecx,edx
	mov ebx, 1	;stdout
	mov edx, ebx	;count
	lea ecx, [esp-4]
	mov [ecx], eax
	mov eax, 4	;sys_write
	int 80h
	pop ebx,ecx,edx
	drop
	ret
code 'key',key
	dup
	push ebx,ecx,edx
	sub ebx,ebx	;0 = stdin
	mov edx, 1	;count
	lea ecx, [esp-4]
	mov eax, 3	;sys_read
	int 80h
	mov eax, [ecx]
	pop ebx,ecx,edx
	ret
;---------------------------------------------------------------------
section .bss
tib  resb   200h
d0   resb 10000h
h0   resb 80000h
section .text
;---------------------------------------------------------------------
