[BITS 16]
[section text]

org 100h

jmp _main

global _main
global _printf

%include "io.asm"


%define _i 0

_main:
	push bp
	mov bp,sp
	sub sp,word 2
	mov [bp+_i],word 0
L1:	
	push word [bp+_i]
	mov bx,word 10
	pop dx
	cmp dx,bx
	jl L2
	push 0
	jmp L3
L2:	
	push 1
L3:	
	pop ax
	cmp ax,word 0
	je L0
	push C0
	call _printf
	add sp,word 2
	inc word [bp+_i]
	jmp L1
L0:	
	mov ax,word 0
	leave
	ret

%undef _i


[section data]
C0: db 'Hello, World!',10,13,0
